Preparing report...

Report for github.com/openfunction/openfunction

(v0.5.0)

A+    Excellent!    Found 37 issues across 92 files

Tweet

gofmt96%

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.


golint63%

Golint is a linter for Go source code.

    • apis/core/v1alpha2/serving_types.go
    • Line 26: warning: exported type KedaScaledObject should have comment or be unexported (golint)
    • Line 43: warning: exported type KedaScaledJob should have comment or be unexported (golint)
    • Line 63: warning: exported type DaprIO should have comment or be unexported (golint)
    • Line 83: warning: exported type Dapr should have comment or be unexported (golint)
    • Line 98: warning: exported type Keda should have comment or be unexported (golint)
    • Line 105: warning: exported type OpenFuncAsyncRuntime should have comment or be unexported (golint)
    • Line 195: warning: exported method ServingStatus.IsStarting should have comment or be unexported (golint)
    • apis/events/v1alpha1/event.go
    • Line 14: warning: exported const ErrorConfiguration should have comment (or a comment on this block) or be unexported (golint)
    • Line 57: warning: exported type Condition should have comment or be unexported (golint)
    • Line 93: warning: exported method Trigger.AddCondition should have comment or be unexported (golint)
    • Line 114: warning: exported function CreateCondition should have comment or be unexported (golint)
    • apis/events/v1alpha1/component_specs.go
    • Line 15: warning: exported const ComponentVersion should have comment (or a comment on this block) or be unexported (golint)
    • Line 25: warning: exported type GenericScaleOption should have comment or be unexported (golint)
    • Line 35: warning: exported type NatsStreamingSpec should have comment or be unexported (golint)
    • Line 53: warning: exported type NatsStreamingScaleOption should have comment or be unexported (golint)
    • Line 62: warning: exported method NatsStreamingSpec.ConvertToMetadataMap should have comment or be unexported (golint)
    • Line 104: warning: exported method NatsStreamingSpec.GenComponent should have comment or be unexported (golint)
    • Line 128: warning: exported method NatsStreamingSpec.GenEventBusScaledObject should have comment or be unexported (golint)
    • Line 165: warning: exported type KafkaSpec should have comment or be unexported (golint)
    • Line 175: warning: exported type KafkaScaleOption should have comment or be unexported (golint)
    • Line 182: warning: exported method KafkaSpec.ConvertToMetadataMap should have comment or be unexported (golint)
    • Line 204: warning: exported method KafkaSpec.GenComponent should have comment or be unexported (golint)
    • Line 228: warning: exported method KafkaSpec.GenScaledObject should have comment or be unexported (golint)
    • Line 252: warning: exported type RedisSpec should have comment or be unexported (golint)
    • Line 276: warning: exported method RedisSpec.ConvertToMetadataMap should have comment or be unexported (golint)
    • Line 344: warning: exported method RedisSpec.GenComponent should have comment or be unexported (golint)
    • Line 368: warning: exported type CronSpec should have comment or be unexported (golint)
    • Line 372: warning: exported method CronSpec.ConvertToMetadataMap should have comment or be unexported (golint)
    • Line 380: warning: exported method CronSpec.GenComponent should have comment or be unexported (golint)
    • Line 404: warning: exported type MQTTSpec should have comment or be unexported (golint)
    • Line 416: warning: exported method MQTTSpec.ConvertToMetadataMap should have comment or be unexported (golint)
    • Line 445: warning: exported method MQTTSpec.GenComponent should have comment or be unexported (golint)
    • apis/core/v1alpha2/function_conversion.go
    • Line 198: warning: receiver name dst should be consistent with previous receiver name src for Function (golint)
    • Line 242: warning: receiver name dst should be consistent with previous receiver name src for Function (golint)
    • Line 269: warning: receiver name dst should be consistent with previous receiver name src for Function (golint)
    • pkg/core/interface.go
    • Line 8: warning: exported const FunctionContainer should have comment (or a comment on this block) or be unexported (golint)
    • Line 12: warning: exported type BuilderRun should have comment or be unexported (golint)
    • Line 27: warning: exported type ServingRun should have comment or be unexported (golint)
    • pkg/util/error.go
    • Line 9: warning: exported const CRNotFound should have comment (or a comment on this block) or be unexported (golint)
    • Line 27: warning: exported function IsNotFound should have comment or be unexported (golint)
    • apis/core/v1alpha1/function_types.go
    • Line 24: warning: exported type GitRepo should have comment or be unexported (golint)
    • Line 38: warning: exported method GitRepo.Init should have comment or be unexported (golint)
    • Line 45: warning: exported type Language should have comment or be unexported (golint)
    • Line 46: warning: exported type Runtime should have comment or be unexported (golint)
    • Line 49: warning: exported const Go should have comment (or a comment on this block) or be unexported (golint)
    • Line 60: warning: exported type Strategy should have comment or be unexported (golint)
    • Line 67: warning: exported type ShipwrightEngine should have comment or be unexported (golint)
    • Line 78: warning: exported type BuildImpl should have comment or be unexported (golint)
    • Line 105: warning: exported type ServingImpl should have comment or be unexported (golint)
    • Line 140: warning: exported type Condition should have comment or be unexported (golint)
    • apis/core/v1alpha1/serving_types.go
    • Line 27: warning: exported type KedaScaledObject should have comment or be unexported (golint)
    • Line 44: warning: exported type KedaScaledJob should have comment or be unexported (golint)
    • Line 64: warning: exported type DaprIO should have comment or be unexported (golint)
    • Line 81: warning: exported type DaprComponent should have comment or be unexported (golint)
    • Line 86: warning: exported type DaprSubscription should have comment or be unexported (golint)
    • Line 93: warning: exported type Dapr should have comment or be unexported (golint)
    • Line 111: warning: exported type Keda should have comment or be unexported (golint)
    • Line 118: warning: exported type OpenFuncAsyncRuntime should have comment or be unexported (golint)
    • apis/core/v1alpha2/function_types.go
    • Line 24: warning: exported type GitRepo should have comment or be unexported (golint)
    • Line 38: warning: exported method GitRepo.Init should have comment or be unexported (golint)
    • Line 45: warning: exported type Language should have comment or be unexported (golint)
    • Line 46: warning: exported type Runtime should have comment or be unexported (golint)
    • Line 49: warning: exported const BuildPhase should have comment (or a comment on this block) or be unexported (golint)
    • Line 65: warning: exported type Strategy should have comment or be unexported (golint)
    • Line 72: warning: exported type ShipwrightEngine should have comment or be unexported (golint)
    • Line 83: warning: exported type BuildImpl should have comment or be unexported (golint)
    • Line 125: warning: exported type ServingImpl should have comment or be unexported (golint)
    • Line 151: warning: exported type ServiceImpl should have comment or be unexported (golint)
    • Line 187: warning: exported type Condition should have comment or be unexported (golint)
    • pkg/util/utils.go
    • Line 7: warning: exported function InterfaceIsNil should have comment or be unexported (golint)
    • Line 16: warning: exported function AppendLabels should have comment or be unexported (golint)
    • pkg/core/serving/openfuncasync/servingrun.go
    • Line 43: warning: exported const FUNCCONTEXT should have comment (or a comment on this block) or be unexported (golint)
    • Line 53: warning: exported function Registry should have comment or be unexported (golint)
    • Line 59: warning: exported function NewServingRun should have comment or be unexported (golint)
    • Line 386: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 389: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 392: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • controllers/events/event.go
    • Line 22: warning: exported const EventSourceControlledLabel should have comment (or a comment on this block) or be unexported (golint)
    • Line 66: warning: exported type EventSourceConfig should have comment or be unexported (golint)
    • Line 74: warning: exported type TriggerConfig should have comment or be unexported (golint)
    • Line 81: warning: exported type Input should have comment or be unexported (golint)
    • Line 88: warning: exported type Subscriber should have comment or be unexported (golint)
    • Line 95: warning: exported method EventSourceConfig.EncodeConfig should have comment or be unexported (golint)
    • Line 99: warning: exported method TriggerConfig.EncodeConfig should have comment or be unexported (golint)
    • Line 112: warning: exported method EventSourceConfig.DecodeEnv should have comment or be unexported (golint)
    • Line 124: warning: exported method TriggerConfig.DecodeEnv should have comment or be unexported (golint)
    • Line 238: warning: exported function InitFunction should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign98%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!