Showing 32 of 32 total issues
Function runDecrypt
has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring. Open
Open
func runDecrypt(b *testing.B, conf Config) {
h, err := CreateHierogolyph(testHierogolyph1.Password, conf)
if err != nil {
b.Error(err)
return
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function runDecrypt
has 9 return statements (exceeds 4 allowed). Open
Open
func runDecrypt(b *testing.B, conf Config) {
h, err := CreateHierogolyph(testHierogolyph1.Password, conf)
if err != nil {
b.Error(err)
return
Method Hierogolyph.Decrypt
has 8 return statements (exceeds 4 allowed). Open
Open
func (h Hierogolyph) Decrypt(cipherText string) (plainText string, err error) {
encryptionKey, encryptedText, err := decodeCipherText(cipherText)
if err != nil {
return "", err
}
Function runEncrypt
has 5 return statements (exceeds 4 allowed). Open
Open
func runEncrypt(b *testing.B, conf Config) {
h, err := CreateHierogolyph(testHierogolyph1.Password, conf)
if err != nil {
b.Error(err)
return
Function Decrypt
has 5 return statements (exceeds 4 allowed). Open
Open
func Decrypt(cipherText, key []byte) (string, error) {
// use first 32byte if the key length is longer than 32byte.
if len(key) > 32 {
key = key[0:32]
}
Function runEncrypt
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
Open
func runEncrypt(b *testing.B, conf Config) {
h, err := CreateHierogolyph(testHierogolyph1.Password, conf)
if err != nil {
b.Error(err)
return
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
exported type Cipher should have comment or be unexported Open
Open
type Cipher struct{}
- Exclude checks
exported const KeySize should have comment (or a comment on this block) or be unexported Open
Open
KeySize = chacha20poly1305.KeySize
- Exclude checks
exported type Hasher should have comment or be unexported Open
Open
type Hasher interface {
- Exclude checks
exported type Config should have comment or be unexported Open
Open
type Config struct {
- Exclude checks
exported type Cipher should have comment or be unexported Open
Open
type Cipher struct{}
- Exclude checks
2: cannot find package "github.com/evalphobia/hierogolyph/crypto/aesgcm" in any of: Open
Open
"github.com/evalphobia/hierogolyph/crypto/aesgcm"
- Exclude checks