Passed
Push — master ( 51e7b4...b93986 )
by Victor Hugo
02:20 queued 01:11
created

devto.decodeResponse   A

Complexity

Conditions 2

Size

Total Lines 7
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2.032

Importance

Changes 0
Metric Value
cc 2
eloc 6
nop 1
dl 0
loc 7
ccs 4
cts 5
cp 0.8
crap 2.032
rs 10
c 0
b 0
f 0
1
package devto
2
3
import (
4
	"io/ioutil"
5
	"net/http"
6
)
7
8
func decodeResponse(r *http.Response) []byte {
9 1
	c, err := ioutil.ReadAll(r.Body)
10 1
	if err != nil {
11
		return []byte("")
12
	}
13 1
	defer r.Body.Close()
14 1
	return c
15
}
16