Preparing report...

Report for github.com/mole-ids/mole

A    Great!    Found 35 issues across 48 files

Tweet

gofmt95%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command


go_vet100%

go vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.

No problems detected. Good job!


gocyclo93%

Gocyclo calculates cyclomatic complexities of functions in Go source code. The cyclomatic complexity of a function is calculated according to the following rules: 1 is the base complexity of a function +1 for each 'if', 'for', 'case', '&&' or '||' Go Report Card warns on functions with cyclomatic complexity > 15.

    • mole/pkg/rules/rules_test.go
    • Line 21: warning: cyclomatic complexity 20 of function TestNewManager() is high (> 15) (gocyclo)
    • Line 294: warning: cyclomatic complexity 19 of function TestLoadRules() is high (> 15) (gocyclo)
    • Line 112: warning: cyclomatic complexity 18 of function TestLoadRulesByDir() is high (> 15) (gocyclo)
    • Line 208: warning: cyclomatic complexity 18 of function TestLoadRulesByIndex() is high (> 15) (gocyclo)

golint31%

Golint is a linter for Go source code.

    • mole/pkg/logger/models/mole.go
    • Line 9: warning: package comment should be of the form "Package models ..." (golint)
    • Line 23: warning: exported const MoleTimestampFormat should have comment or be unexported (golint)
    • Line 25: warning: exported type MoleTime should have comment or be unexported (golint)
    • Line 27: warning: exported method MoleTime.UnmarshalJSON should have comment or be unexported (golint)
    • Line 36: warning: exported method MoleTime.MarshalJSON should have comment or be unexported (golint)
    • Line 40: warning: exported method MoleTime.GetMoletime should have comment or be unexported (golint)
    • Line 61: warning: exported type AlertEvent should have comment or be unexported (golint)
    • Line 68: warning: exported type MatchString should have comment or be unexported (golint)
    • Line 75: warning: exported type TagArray should have comment or be unexported (golint)
    • Line 76: warning: exported type MetaMap should have comment or be unexported (golint)
    • Line 77: warning: exported type MatchArray should have comment or be unexported (golint)
    • Line 79: warning: exported method EveEvent.MarshalLogObject should have comment or be unexported (golint)
    • Line 93: warning: exported method AlertEvent.MarshalLogObject should have comment or be unexported (golint)
    • Line 101: warning: exported method TagArray.MarshalLogArray should have comment or be unexported (golint)
    • Line 108: warning: exported method MetaMap.MarshalLogObject should have comment or be unexported (golint)
    • Line 115: warning: exported method MatchString.MarshalLogObject should have comment or be unexported (golint)
    • Line 123: warning: exported method MatchArray.MarshalLogArray should have comment or be unexported (golint)
    • mole/pkg/rules/messages.go
    • Line 9: warning: package comment should be of the form "Package rules ..." (golint)
    • Line 19: warning: exported const RuleFolderPathIsNotAbsMsg should have comment (or a comment on this block) or be unexported (golint)
    • Line 38: warning: exported var ErrRuleFolderPathIsNotAbs should have comment or be unexported (golint)
    • mole/internal/nodes/port.go
    • Line 9: warning: package comment should be of the form "Package nodes ..." (golint)
    • Line 269: warning: exported method NodePort.GetInverse should have comment or be unexported (golint)
    • mole/pkg/interfaces/messages.go
    • Line 9: warning: package comment should be of the form "Package interfaces ..." (golint)
    • Line 19: warning: exported const IfaceOrFileNameIsNeededMsg should have comment (or a comment on this block) or be unexported (golint)
    • Line 43: warning: exported var ErrIfaceOrFileNotProvided should have comment or be unexported (golint)
    • mole/pkg/interfaces/iface.go
    • Line 9: warning: package comment should be of the form "Package interfaces ..." (golint)
    • Line 99: warning: exported method Interfaces.TrafficHandler should have comment or be unexported (golint)
    • mole/pkg/engine/types.go
    • Line 9: warning: package comment should be of the form "Package engine ..." (golint)
    • Line 30: warning: exported type PacketExtractor should have comment or be unexported (golint)
    • Line 55: warning: exported function NewPacketExtractor should have comment or be unexported (golint)
    • Line 62: warning: exported method PacketExtractor.AddNetworkLayer should have comment or be unexported (golint)
    • Line 86: warning: exported method PacketExtractor.AddTransportLayer should have comment or be unexported (golint)
    • Line 123: warning: exported method PacketExtractor.AddApplicationLayer should have comment or be unexported (golint)
    • Line 127: warning: exported method PacketExtractor.GetPacketPayload should have comment or be unexported (golint)
    • Line 139: warning: exported method PacketExtractor.GetPacketMetadata should have comment or be unexported (golint)
    • Line 143: warning: exported method PacketExtractor.GetIPv4 should have comment or be unexported (golint)
    • Line 147: warning: exported method PacketExtractor.GetTCP should have comment or be unexported (golint)
    • Line 151: warning: exported method PacketExtractor.GetUDP should have comment or be unexported (golint)
    • Line 155: warning: exported method PacketExtractor.GetSCTP should have comment or be unexported (golint)
    • Line 159: warning: exported method PacketExtractor.GetIfaceName should have comment or be unexported (golint)
    • Line 167: warning: exported method PacketExtractor.GetMetadata should have comment or be unexported (golint)
    • mole/internal/nodes/messages.go
    • Line 9: warning: package comment should be of the form "Package nodes ..." (golint)
    • Line 19: warning: exported const ConversionTypeMsg should have comment (or a comment on this block) or be unexported (golint)
    • Line 30: warning: exported var ErrConversionType should have comment or be unexported (golint)
    • mole/pkg/logger/config.go
    • Line 9: warning: package comment should be of the form "Package logger ..." (golint)
    • Line 30: warning: exported type MoleLogger should have comment or be unexported (golint)
    • mole/pkg/logger/messages.go
    • Line 9: warning: package comment should be of the form "Package logger ..." (golint)
    • Line 19: warning: exported const LoggerConfigInitFailedMsg should have comment (or a comment on this block) or be unexported (golint)
    • Line 26: warning: exported var ErrBuildingZapFieldsFailed should have comment or be unexported (golint)
    • mole/pkg/rules/main_test.go
    • Line 29: warning: don't use underscores in Go names; var test_dir should be testDir (golint)
    • Line 55: warning: don't use underscores in Go names; const test_rulesDir should be testRulesDir (golint)
    • Line 56: warning: don't use underscores in Go names; const test_rulesIndex should be testRulesIndex (golint)
    • Line 57: warning: don't use underscores in Go names; const test_rulesName should be testRulesName (golint)
    • Line 59: warning: don't use underscores in Go names; const test_cstyle should be testCstyle (golint)
    • Line 60: warning: don't use underscores in Go names; const test_cppstyle should be testCppstyle (golint)
    • Line 62: warning: don't use underscores in Go names; const test_rule should be testRule (golint)
    • Line 79: warning: don't use underscores in Go names; const test_config should be testConfig (golint)
    • Line 87: warning: don't use underscores in Go names; const test_config_index should be testConfigIndex (golint)
    • Line 95: warning: don't use underscores in Go names; const test_config_dir should be testConfigDir (golint)
    • mole/cmd/root.go
    • Line 9: warning: package comment should be of the form "Package cmd ..." (golint)
    • Line 30: warning: exported var AppName should have comment or be unexported (golint)
    • mole/pkg/engine/engine.go
    • Line 9: warning: package comment should be of the form "Package engine ..." (golint)
    • Line 63: warning: exported const IPV4 should have comment (or a comment on this block) or be unexported (golint)
    • mole/internal/tree/messages.go
    • Line 9: warning: package comment should be of the form "Package tree ..." (golint)
    • Line 19: warning: exported const RuleMapBuiltMsg should have comment (or a comment on this block) or be unexported (golint)
    • Line 34: warning: exported var ErrCompiledRulesNotFound should have comment or be unexported (golint)
    • mole/pkg/logger/vars_test.go
    • Line 28: warning: don't use underscores in Go names; var test_dir should be testDir (golint)
    • Line 32: warning: don't use underscores in Go names; var test_dir should be testDir (golint)
    • mole/pkg/engine/messages.go
    • Line 9: warning: package comment should be of the form "Package engine ..." (golint)
    • Line 17: warning: exported const MainEventOuterMsg should have comment (or a comment on this block) or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell95%

Misspell Finds commonly misspelled English words