Showing 23 of 31 total issues
Method YamlManipulator.ApplyToLeafs
has 11 return statements (exceeds 4 allowed). Open
Open
func (manipulator YamlManipulator) ApplyToLeafs(callback func([]byte) ([]byte, error), data interface{}) (interface{}, error) {
switch data.(type) {
case yaml.MapSlice:
result := make(yaml.MapSlice, len(data.(yaml.MapSlice)))
for ind, elm := range data.(yaml.MapSlice) {
Method YamlManipulator.ApplyToLeafs
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
Open
func (manipulator YamlManipulator) ApplyToLeafs(callback func([]byte) ([]byte, error), data interface{}) (interface{}, error) {
switch data.(type) {
case yaml.MapSlice:
result := make(yaml.MapSlice, len(data.(yaml.MapSlice)))
for ind, elm := range data.(yaml.MapSlice) {
- 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
Your code does not pass gofmt in 3 places. Go fmt your code! Open
Open
package aes
- Exclude checks
Your code does not pass gofmt in 2 places. Go fmt your code! Open
Open
package dummy
- Exclude checks
Your code does not pass gofmt in 2 places. Go fmt your code! Open
Open
package encrypt
- Exclude checks
Your code does not pass gofmt in 1 place. Go fmt your code! Open
Open
package document
- Exclude checks
Your code does not pass gofmt in 1 place. Go fmt your code! Open
Open
package io
- Exclude checks
exported func NewDecrypt returns unexported type *decrypt.decrypt, which can be annoying to use Confirmed
Confirmed
func NewDecrypt(encryptionService DecryptionService, documentManipulator YamlManipulator) *decrypt {
- Exclude checks
don't use MixedCaps in package name; generateSecretKey should be generatesecretkey Open
Open
package generateSecretKey
- Exclude checks
exported function NewGenerateSecretKey should have comment or be unexported Open
Open
func NewGenerateSecretKey(generator SecretKeyGenerator) *generateSecretKey {
- Exclude checks
exported type SecretKeyGenerator should have comment or be unexported Open
Open
type SecretKeyGenerator interface {
- Exclude checks
comment on exported type YamlManipulator should be of the form "YamlManipulator ..." (with optional leading article) Open
Open
//data types: yaml.MapSlice, yaml.MapItem, and Exact value
- Exclude checks
exported type EncryptionService should have comment or be unexported Open
Open
type EncryptionService interface {
- Exclude checks
exported func NewFile returns unexported type *io.file, which can be annoying to use Confirmed
Confirmed
func NewFile(path string) *file {
- Exclude checks
exported type CryptoGeneratorService should have comment or be unexported Open
Open
type CryptoGeneratorService struct {
- Exclude checks
2: cannot find package "github.com/antonmarin/secret-yaml/document" in any of: Open
Open
"github.com/antonmarin/secret-yaml/document"
- Exclude checks
exported type DecryptionService should have comment or be unexported Open
Open
type DecryptionService interface {
- Exclude checks
exported func NewGenerateSecretKey returns unexported type *generateSecretKey.generateSecretKey, which can be annoying to use Open
Open
func NewGenerateSecretKey(generator SecretKeyGenerator) *generateSecretKey {
- Exclude checks
Your code does not pass gofmt in 1 place. Go fmt your code! Open
Open
package decrypt
- Exclude checks
exported method CryptoGeneratorService.GenerateSecretKey should have comment or be unexported Open
Open
func (service CryptoGeneratorService) GenerateSecretKey() ([]byte, error) {
- Exclude checks