GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( dbcb3a...736483 )
by Victor Hugo
01:11 queued 12s
created

idempotency.NewNopGenerator   A

Complexity

Conditions 2

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 5
dl 0
loc 7
c 0
b 0
f 0
ccs 3
cts 3
cp 1
crap 2
rs 10
nop 1
1
package idempotency
2
3
// NOpIdempotencyGenerator is a dummy implementation of the
4
// IdempotencyKeyGenerator interface.
5
//
6
// Good for testing or when a predictable result is required.
7
type nOpIdempotencyGenerator struct {
8
	expected string
9
}
10
11
const (
12
	TestKeyExpected = "test_ikg_key"
13
)
14
15
// Generate encapsulates the logic to return a string representation of
16
// a unique idempotency key.
17
func (nopIKG nOpIdempotencyGenerator) Generate() string {
18 1
	return nopIKG.expected
19
}
20
21
// NewNopGenerator returns a dummy implementation of the
22
// IdempotencyKeyGenerator interface.
23
//
24
// Good for testing or when a predictable result is required.
25
//
26
// If exp is an empty string, then TestKeyExpected is used as
27
// default value for the NOpGenerator.
28
func NewNopGenerator(exp string) KeyGenerator {
29 1
	if exp == "" {
30 1
		exp = TestKeyExpected
31
	}
32
33 1
	return nOpIdempotencyGenerator{
34
		expected: exp,
35
	}
36
}
37