inklabs/rangedb

View on GitHub
pkg/eventparser/event_parser.go

Summary

Maintainability
C
1 day
Test Coverage
A
100%

Showing 3 of 3 total issues

Method structVisitor.Visit has a Cognitive Complexity of 55 (exceeds 20 allowed). Consider refactoring.
Open

func (v *structVisitor) Visit(node ast.Node) (w ast.Visitor) {
switch n := node.(type) {
case *ast.TypeSpec:
if value, ok := n.Type.(*ast.StructType); ok {
var subjectID string
Severity: Minor
Found in pkg/eventparser/event_parser.go - About 6 hrs to fix

Method structVisitor.Visit has 66 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (v *structVisitor) Visit(node ast.Node) (w ast.Visitor) {
switch n := node.(type) {
case *ast.TypeSpec:
if value, ok := n.Type.(*ast.StructType); ok {
var subjectID string
Severity: Minor
Found in pkg/eventparser/event_parser.go - About 1 hr to fix

    Avoid deeply nested control flow statements.
    Open

    if serializedFields == nil {
    serializedFields = make(map[string]string)
    }
    Severity: Major
    Found in pkg/eventparser/event_parser.go - About 45 mins to fix
      Category
      Status