Preparing report...

Report for github.com/omec-project/upf

(v0.3.0)

A+    Excellent!    Found 32 issues across 52 files

Tweet

gofmt100%

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

No problems detected. Good job!


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!


gocyclo78%

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.

    • pfcpiface/parse_pdr.go
    • Line 514: warning: cyclomatic complexity 17 of function (*pdr).parsePDI() is high (> 15) (gocyclo)
    • Line 564: warning: cyclomatic complexity 16 of function (*pdr).parsePDR() is high (> 15) (gocyclo)
    • pfcpiface/up4.go
    • Line 1087: warning: cyclomatic complexity 24 of function (*UP4).modifyUP4ForwardingConfiguration() is high (> 15) (gocyclo)
    • pfcpiface/bess.go
    • Line 420: warning: cyclomatic complexity 17 of function (*bess).sessionStats() is high (> 15) (gocyclo)
    • Line 120: warning: cyclomatic complexity 16 of function (*bess).sendMsgToUPF() is high (> 15) (gocyclo)

golint44%

Golint is a linter for Go source code.

    • pfcpiface/ip_pool.go
    • Line 15: warning: exported type IPPool should have comment or be unexported (golint)
    • Line 50: warning: exported method IPPool.LookupOrAllocIP should have comment or be unexported (golint)
    • Line 77: warning: exported method IPPool.DeallocIP should have comment or be unexported (golint)
    • pfcpiface/messages.go
    • Line 18: warning: exported type HandlePFCPMsgError should have comment or be unexported (golint)
    • Line 35: warning: exported type Request should have comment or be unexported (golint)
    • Line 44: warning: exported method Request.GetResponse should have comment or be unexported (golint)
    • Line 128: warning: exported method PFCPConn.SendPFCPMsg should have comment or be unexported (golint)
    • pfcpiface/node.go
    • Line 1: warning: package comment should be of the form "Package pfcpiface ..." (golint)
    • Line 158: warning: exported method PFCPNode.Stop should have comment or be unexported (golint)
    • pfcpiface/parse_far.go
    • Line 16: warning: exported const FwdIEOuterHeaderCreation should have comment (or a comment on this block) or be unexported (golint)
    • Line 22: warning: exported const ActionForward should have comment (or a comment on this block) or be unexported (golint)
    • pfcpiface/session_qer.go
    • Line 10: warning: exported type QosLevel should have comment or be unexported (golint)
    • Line 13: warning: exported const ApplicationQos should have comment (or a comment on this block) or be unexported (golint)
    • Line 34: warning: comment on exported function Intersect should be of the form "Intersect ..." (golint)
    • pfcpiface/web_service.go
    • Line 37: warning: exported type ConfigHandler should have comment or be unexported (golint)
    • Line 120: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • pfcpiface/metrics/interface.go
    • Line 8: warning: exported type Message should have comment or be unexported (golint)
    • Line 18: warning: exported function NewMessage should have comment or be unexported (golint)
    • Line 27: warning: exported method Message.Finish should have comment or be unexported (golint)
    • Line 33: warning: exported type Session should have comment or be unexported (golint)
    • Line 40: warning: exported function NewSession should have comment or be unexported (golint)
    • Line 47: warning: exported method Session.Delete should have comment or be unexported (golint)
    • Line 51: warning: exported type InstrumentPFCP should have comment or be unexported (golint)
    • pfcpiface/p4rt_translator.go
    • Line 80: warning: exported type P4rtTranslator should have comment or be unexported (golint)
    • Line 498: warning: exported method P4rtTranslator.BuildInterfaceTableEntryNoAction should have comment or be unexported (golint)
    • Line 509: warning: exported method P4rtTranslator.BuildInterfaceTableEntry should have comment or be unexported (golint)
    • Line 553: warning: exported method P4rtTranslator.BuildApplicationsTableEntry should have comment or be unexported (golint)
    • Line 707: warning: exported method P4rtTranslator.BuildSessionsTableEntry should have comment or be unexported (golint)
    • Line 868: warning: exported method P4rtTranslator.BuildTerminationsTableEntry should have comment or be unexported (golint)
    • Line 879: warning: exported method P4rtTranslator.BuildGTPTunnelPeerTableEntry should have comment or be unexported (golint)
    • Line 920: warning: exported method P4rtTranslator.BuildMeterEntry should have comment or be unexported (golint)
    • pfcpiface/pfcpiface.go
    • Line 27: warning: exported type PFCPIface should have comment or be unexported (golint)
    • Line 41: warning: exported function NewPFCPIface should have comment or be unexported (golint)
    • Line 64: warning: exported method PFCPIface.Run should have comment or be unexported (golint)
    • test/integration/conf.go
    • Line 14: warning: exported const ConfigDefault should have comment (or a comment on this block) or be unexported (golint)
    • Line 24: warning: exported function BESSConfigDefault should have comment or be unexported (golint)
    • Line 44: warning: exported function BESSConfigUPFBasedIPAllocation should have comment or be unexported (golint)
    • Line 54: warning: exported function UP4ConfigDefault should have comment or be unexported (golint)
    • Line 82: warning: exported function UP4ConfigUPFBasedIPAllocation should have comment or be unexported (golint)
    • Line 92: warning: exported function GetConfig should have comment or be unexported (golint)
    • pfcpiface/parse_sdf.go
    • Line 19: warning: exported const Ipv4WildcardNetString should have comment (or a comment on this block) or be unexported (golint)
    • pfcpiface/telemetry.go
    • Line 102: warning: exported function NewPFCPNodeCollector should have comment or be unexported (golint)
    • Line 132: warning: exported method PfcpNodeCollector.Describe should have comment or be unexported (golint)
    • Line 136: warning: exported method PfcpNodeCollector.Collect should have comment or be unexported (golint)
    • pkg/bessmock/bessmock.go
    • Line 13: warning: exported type BESSMock should have comment or be unexported (golint)
    • Line 21: warning: exported function NewBESSMock should have comment or be unexported (golint)
    • Line 29: warning: exported method BESSMock.Run should have comment or be unexported (golint)
    • Line 47: warning: exported method BESSMock.Stop should have comment or be unexported (golint)
    • pfcpiface/errors.go
    • Line 1: warning: package comment should be of the form "Package pfcpiface ..." (golint)
    • Line 18: warning: exported function ErrUnsupported should have comment or be unexported (golint)
    • Line 22: warning: exported function ErrNotFound should have comment or be unexported (golint)
    • Line 26: warning: exported function ErrNotFoundWithParam should have comment or be unexported (golint)
    • Line 30: warning: exported function ErrInvalidOperation should have comment or be unexported (golint)
    • Line 34: warning: exported function ErrInvalidArgument should have comment or be unexported (golint)
    • Line 38: warning: exported function ErrInvalidArgumentWithReason should have comment or be unexported (golint)
    • Line 42: warning: exported function ErrOperationFailedWithReason should have comment or be unexported (golint)
    • Line 46: warning: exported function ErrOperationFailedWithParam should have comment or be unexported (golint)
    • pfcpiface/parse_pdr.go
    • Line 64: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 100: warning: exported type RangeConversionStrategy should have comment or be unexported (golint)
    • Line 103: warning: exported const Exact should have comment (or a comment on this block) or be unexported (golint)
    • test/integration/framework.go
    • Line 27: warning: exported const EnvMode should have comment (or a comment on this block) or be unexported (golint)
    • Line 56: warning: exported type UEState should have comment or be unexported (golint)
    • Line 153: warning: exported function TimeBasedElectionId should have comment or be unexported (golint)
    • Line 166: warning: exported function IsConnectionOpen should have comment or be unexported (golint)
    • test/integration/verify.go
    • Line 18: warning: comment on exported const MeterSession should be of the form "MeterSession ..." (golint)
    • Line 20: warning: exported const MeterApp should have comment (or a comment on this block) or be unexported (golint)
    • pfcpiface/p4rtc.go
    • Line 55: warning: exported type P4RuntimeError should have comment or be unexported (golint)
    • Line 63: warning: exported method P4RuntimeError.Get should have comment or be unexported (golint)
    • Line 202: warning: exported method P4rtClient.GetNextDigestData should have comment or be unexported (golint)
    • Line 286: warning: exported method P4rtClient.ClearTable should have comment or be unexported (golint)
    • Line 313: warning: exported method P4rtClient.ClearTables should have comment or be unexported (golint)
    • Line 370: warning: exported method P4rtClient.ApplyTableEntries should have comment or be unexported (golint)
    • Line 388: warning: exported method P4rtClient.ApplyMeterEntries should have comment or be unexported (golint)
    • pfcpiface/upf.go
    • Line 23: warning: exported type SliceInfo should have comment or be unexported (golint)
    • Line 32: warning: exported type UeResource should have comment or be unexported (golint)
    • Line 91: warning: exported function NewUPF should have comment or be unexported (golint)
    • pfcpiface/metrics/prometheus.go
    • Line 12: warning: exported type Service should have comment or be unexported (golint)
    • Line 20: warning: exported function NewPrometheusService should have comment or be unexported (golint)
    • Line 82: warning: exported method Service.SaveMessages should have comment or be unexported (golint)
    • Line 87: warning: exported method Service.SaveSessions should have comment or be unexported (golint)
    • Line 97: warning: exported method Service.Stop should have comment or be unexported (golint)
    • pfcpiface/bess.go
    • Line 32: warning: comment on exported const AppQerLookup should be of the form "AppQerLookup ..." (golint)
    • Line 34: warning: comment on exported const SessQerLookup should be of the form "SessQerLookup ..." (golint)
    • Line 36: warning: comment on exported const PreQosFlowMeasure should be of the form "PreQosFlowMeasure ..." (golint)
    • Line 38: warning: comment on exported const PostDlQosFlowMeasure should be of the form "PostDlQosFlowMeasure ..." (golint)
    • Line 40: warning: comment on exported const PostUlQosFlowMeasure should be of the form "PostUlQosFlowMeasure ..." (golint)
    • Line 47: warning: comment on exported const KB should be of the form "KB ..." (golint)
    • Line 49: warning: exported const MB should have comment (or a comment on this block) or be unexported (golint)
    • pfcpiface/conn.go
    • Line 22: warning: exported const PFCPPort should have comment (or a comment on this block) or be unexported (golint)
    • internal/p4constants/p4constants.go
    • Line 7: warning: comment on exported const HdrPreQosPipeRoutingRoutesV4DstPrefix should be of the form "HdrPreQosPipeRoutingRoutesV4DstPrefix ..." (golint)
    • Line 9: warning: exported const HdrPreQosPipeAclAclsInport should have comment (or a comment on this block) or be unexported (golint)
    • Line 33: warning: comment on exported const TablePreQosPipeRoutingRoutesV4 should be of the form "TablePreQosPipeRoutingRoutesV4 ..." (golint)
    • Line 44: warning: comment on exported const ActionNoAction should be of the form "ActionNoAction ..." (golint)
    • Line 70: warning: comment on exported const ActionParamPreQosPipeRoutingRouteSrcMac should be of the form "ActionParamPreQosPipeRoutingRouteSrcMac ..." (golint)
    • Line 102: warning: comment on exported const CounterPreQosPipePreQosCounter should be of the form "CounterPreQosPipePreQosCounter ..." (golint)
    • Line 107: warning: comment on exported const DirectCounterAcls should be of the form "DirectCounterAcls ..." (golint)
    • Line 109: warning: comment on exported const ActionProfileHashedSelector should be of the form "ActionProfileHashedSelector ..." (golint)
    • Line 111: warning: comment on exported const PacketMetaPacketOut should be of the form "PacketMetaPacketOut ..." (golint)
    • Line 114: warning: comment on exported const MeterPreQosPipeAppMeter should be of the form "MeterPreQosPipeAppMeter ..." (golint)
    • Line 121: warning: exported function GetTableIDToNameMap should have comment or be unexported (golint)
    • Line 136: warning: exported function GetTableIDList should have comment or be unexported (golint)
    • Line 151: warning: exported function GetActionIDToNameMap should have comment or be unexported (golint)
    • Line 181: warning: exported function GetActionIDList should have comment or be unexported (golint)
    • Line 211: warning: exported function GetActionProfileIDToNameMap should have comment or be unexported (golint)
    • Line 217: warning: exported function GetActionProfileIDList should have comment or be unexported (golint)
    • Line 223: warning: exported function GetCounterIDToNameMap should have comment or be unexported (golint)
    • Line 230: warning: exported function GetCounterIDList should have comment or be unexported (golint)
    • Line 237: warning: exported function GetDirectCounterIDToNameMap should have comment or be unexported (golint)
    • Line 243: warning: exported function GetDirectCounterIDList should have comment or be unexported (golint)
    • Line 249: warning: exported function GetMeterIDToNameMap should have comment or be unexported (golint)
    • Line 256: warning: exported function GetMeterIDList should have comment or be unexported (golint)
    • Line 263: warning: exported function GetDirectMeterIDToNameMap should have comment or be unexported (golint)
    • Line 267: warning: exported function GetDirectMeterIDList should have comment or be unexported (golint)
    • Line 271: warning: exported function GetControllerPacketMetadataIDToNameMap should have comment or be unexported (golint)
    • Line 278: warning: exported function GetControllerPacketMetadataIDList should have comment or be unexported (golint)
    • Line 285: warning: exported function GetRegisterIDToNameMap should have comment or be unexported (golint)
    • Line 289: warning: exported function GetRegisterIDList should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign96%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!