Preparing report...

Report for github.com/caeril/frevel/cmd

(v0.0.0-20210805220405-6d3228f1624d)

C    Needs some work    Found 60 issues across 66 files

Tweet

gofmt42%

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!


gocyclo84%

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.

    • parser2/source_info_processor.go
    • Line 24: warning: cyclomatic complexity 19 of function (*SourceInfoProcessor).processPackage() is high (> 15) (gocyclo)
    • Line 194: warning: cyclomatic complexity 18 of function (*SourceInfoProcessor).getControllerFunc() is high (> 15) (gocyclo)
    • parser/reflect.go
    • Line 58: warning: cyclomatic complexity 18 of function (*processContainer).processPath() is high (> 15) (gocyclo)
    • logger/terminal_format.go
    • Line 157: warning: cyclomatic complexity 18 of function escapeString() is high (> 15) (gocyclo)
    • Line 28: warning: cyclomatic complexity 16 of function TerminalFormatHandler() is high (> 15) (gocyclo)
    • model/command_config.go
    • Line 63: warning: cyclomatic complexity 28 of function (*CommandConfig).UpdateImportPath() is high (> 15) (gocyclo)
    • Line 145: warning: cyclomatic complexity 19 of function (*CommandConfig).initAppFolder() is high (> 15) (gocyclo)
    • frevel/test.go
    • Line 78: warning: cyclomatic complexity 17 of function testApp() is high (> 15) (gocyclo)

golint31%

Golint is a linter for Go source code.

    • utils/strings.go
    • Line 3: warning: comment on exported function ContainsString should be of the form "ContainsString ..." (golint)
    • model/source_info.go
    • Line 12: warning: exported type SourceInfo should have comment or be unexported (golint)
    • Line 129: warning: exported method SourceInfo.Merge should have comment or be unexported (golint)
    • frevel/test.go
    • Line 85: warning: don't use underscores in Go names; var revel_path should be revelPath (golint)
    • utils/log.go
    • Line 11: warning: exported var Logger should have comment or be unexported (golint)
    • Line 13: warning: exported function InitLogger should have comment or be unexported (golint)
    • Line 33: warning: comment on exported function Retry should be of the form "Retry ..." (golint)
    • Line 44: warning: exported type LoggedError should have comment or be unexported (golint)
    • Line 46: warning: exported function NewLoggedError should have comment or be unexported (golint)
    • logger/init.go
    • Line 13: warning: exported function InitializeFromConfig should have comment or be unexported (golint)
    • logger/revel_logger.go
    • Line 10: warning: comment on exported type RevelLogger should be of the form "RevelLogger ..." (with optional leading article) (golint)
    • Line 15: warning: comment on exported function SetDefaultLog should be of the form "SetDefaultLog ..." (golint)
    • Line 23: warning: exported method RevelLogger.Debugf should have comment or be unexported (golint)
    • Line 27: warning: comment on exported method RevelLogger.Infof should be of the form "Infof ..." (golint)
    • Line 32: warning: comment on exported method RevelLogger.Warnf should be of the form "Warnf ..." (golint)
    • Line 37: warning: comment on exported method RevelLogger.Errorf should be of the form "Errorf ..." (golint)
    • Line 42: warning: comment on exported method RevelLogger.Critf should be of the form "Critf ..." (golint)
    • Line 47: warning: comment on exported method RevelLogger.Fatalf should be of the form "Fatalf ..." (golint)
    • Line 52: warning: comment on exported method RevelLogger.Panicf should be of the form "Panicf ..." (golint)
    • Line 57: warning: comment on exported method RevelLogger.Fatal should be of the form "Fatal ..." (golint)
    • Line 63: warning: comment on exported method RevelLogger.Panic should be of the form "Panic ..." (golint)
    • Line 69: warning: comment on exported method RevelLogger.New should be of the form "New ..." (golint)
    • Line 75: warning: comment on exported method RevelLogger.SetStackDepth should be of the form "SetStackDepth ..." (golint)
    • Line 81: warning: comment on exported function New should be of the form "New ..." (golint)
    • Line 88: warning: comment on exported method RevelLogger.SetHandler should be of the form "SetHandler ..." (golint)
    • Line 125: warning: comment on exported type ContextMap should be of the form "ContextMap ..." (with optional leading article) (golint)
    • Line 128: warning: comment on exported method ContextMap.StringMap should be of the form "StringMap ..." (golint)
    • Line 140: warning: exported method ContextMap.Add should have comment or be unexported (golint)
    • model/event.go
    • Line 4: warning: comment on exported type Event should be of the form "Event ..." (with optional leading article) (golint)
    • Line 6: warning: comment on exported type EventResponse should be of the form "EventResponse ..." (with optional leading article) (golint)
    • Line 8: warning: comment on exported type EventHandler should be of the form "EventHandler ..." (with optional leading article) (golint)
    • Line 10: warning: exported type RevelCallback should have comment or be unexported (golint)
    • Line 17: warning: comment on exported const TEMPLATE_REFRESH_REQUESTED should be of the form "TEMPLATE_REFRESH_REQUESTED ..." (golint)
    • Line 19: warning: comment on exported const TEMPLATE_REFRESH_COMPLETED should be of the form "TEMPLATE_REFRESH_COMPLETED ..." (golint)
    • Line 23: warning: comment on exported const REVEL_BEFORE_MODULES_LOADED should be of the form "REVEL_BEFORE_MODULES_LOADED ..." (golint)
    • Line 25: warning: comment on exported const REVEL_BEFORE_MODULE_LOADED should be of the form "REVEL_BEFORE_MODULE_LOADED ..." (golint)
    • Line 27: warning: comment on exported const REVEL_AFTER_MODULE_LOADED should be of the form "REVEL_AFTER_MODULE_LOADED ..." (golint)
    • Line 29: warning: comment on exported const REVEL_AFTER_MODULES_LOADED should be of the form "REVEL_AFTER_MODULES_LOADED ..." (golint)
    • Line 32: warning: comment on exported const ENGINE_BEFORE_INITIALIZED should be of the form "ENGINE_BEFORE_INITIALIZED ..." (golint)
    • Line 34: warning: comment on exported const ENGINE_STARTED should be of the form "ENGINE_STARTED ..." (golint)
    • Line 36: warning: comment on exported const ENGINE_SHUTDOWN should be of the form "ENGINE_SHUTDOWN ..." (golint)
    • Line 39: warning: comment on exported const ROUTE_REFRESH_REQUESTED should be of the form "ROUTE_REFRESH_REQUESTED ..." (golint)
    • Line 41: warning: comment on exported const ROUTE_REFRESH_COMPLETED should be of the form "ROUTE_REFRESH_COMPLETED ..." (golint)
    • Line 44: warning: comment on exported const REVEL_FAILURE should be of the form "REVEL_FAILURE ..." (golint)
    • Line 50: warning: comment on exported function RaiseEvent should be of the form "RaiseEvent ..." (golint)
    • Line 58: warning: comment on exported function AddInitEventHandler should be of the form "AddInitEventHandler ..." (golint)
    • model/type_expr.go
    • Line 9: warning: exported type TypeExpr should have comment or be unexported (golint)
    • Line 16: warning: comment on exported function NewTypeExprFromData should be of the form "NewTypeExprFromData ..." (golint)
    • Line 21: warning: comment on exported function NewTypeExprFromAst should be of the form "NewTypeExprFromAst ..." (golint)
    • Line 94: warning: comment on exported function FirstNonEmpty should be of the form "FirstNonEmpty ..." (golint)
    • frevel/new.go
    • Line 330: warning: exported const VENDOR_GOPKG should have comment (or a comment on this block) or be unexported (golint)
    • logger/composite_multihandler.go
    • Line 10: warning: exported type CompositeMultiHandler should have comment or be unexported (golint)
    • Line 18: warning: exported function NewCompositeMultiHandler should have comment or be unexported (golint)
    • Line 22: warning: exported method CompositeMultiHandler.Log should have comment or be unexported (golint)
    • Line 46: warning: exported method CompositeMultiHandler.SetHandler should have comment or be unexported (golint)
    • Line 81: warning: comment on exported method CompositeMultiHandler.SetHandlers should be of the form "SetHandlers ..." (golint)
    • Line 93: warning: exported method CompositeMultiHandler.SetJson should have comment or be unexported (golint)
    • Line 104: warning: comment on exported method CompositeMultiHandler.SetJsonFile should be of the form "SetJsonFile ..." (golint)
    • Line 116: warning: exported method CompositeMultiHandler.SetTerminal should have comment or be unexported (golint)
    • Line 144: warning: comment on exported method CompositeMultiHandler.SetTerminalFile should be of the form "SetTerminalFile ..." (golint)
    • Line 156: warning: exported method CompositeMultiHandler.Disable should have comment or be unexported (golint)
    • parser/validation.go
    • Line 10: warning: comment on exported function GetValidationKeys should be of the form "GetValidationKeys ..." (golint)
    • utils/error.go
    • Line 9: warning: comment on exported type SourceError should be of the form "SourceError ..." (with optional leading article) (golint)
    • Line 9: warning: comment on exported type SourceLine should be of the form "SourceLine ..." (with optional leading article) (golint)
    • Line 26: warning: comment on exported function NewError should be of the form "NewError ..." (golint)
    • Line 36: warning: comment on exported method SourceError.SetLink should be of the form "SetLink ..." (golint)
    • logger/logger.go
    • Line 11: warning: comment on exported type MultiLogger should be of the form "MultiLogger ..." (with optional leading article) (golint)
    • Line 66: warning: comment on exported type LogHandler should be of the form "LogHandler ..." (with optional leading article) (golint)
    • Line 72: warning: comment on exported type LogStackHandler should be of the form "LogStackHandler ..." (with optional leading article) (golint)
    • Line 78: warning: comment on exported type ParentLogHandler should be of the form "ParentLogHandler ..." (with optional leading article) (golint)
    • Line 83: warning: comment on exported type LogFormat should be of the form "LogFormat ..." (with optional leading article) (golint)
    • Line 88: warning: comment on exported type LogLevel should be of the form "LogLevel ..." (with optional leading article) (golint)
    • Line 91: warning: comment on exported type LogOptions should be of the form "LogOptions ..." (with optional leading article) (golint)
    • Line 100: warning: comment on exported type Record should be of the form "Record ..." (with optional leading article) (golint)
    • Line 109: warning: comment on exported type Lazy should be of the form "Lazy ..." (with optional leading article) (golint)
    • Line 114: warning: comment on exported type CallStack should be of the form "CallStack ..." (with optional leading article) (golint)
    • Line 132: warning: exported function NewRecord should have comment or be unexported (golint)
    • Line 137: warning: exported const LvlCrit should have comment (or a comment on this block) or be unexported (golint)
    • Line 144: warning: comment on exported var LvlAllList should be of the form "LvlAllList ..." (golint)
    • Line 152: warning: comment on exported function NewParentLogHandler should be of the form "NewParentLogHandler ..." (golint)
    • Line 162: warning: comment on exported function NewLogOptions should be of the form "NewLogOptions ..." (golint)
    • Line 174: warning: comment on exported method LogOptions.SetExtendedOptions should be of the form "SetExtendedOptions ..." (golint)
    • Line 181: warning: comment on exported method LogOptions.GetStringDefault should be of the form "GetStringDefault ..." (golint)
    • Line 189: warning: comment on exported method LogOptions.GetIntDefault should be of the form "GetIntDefault ..." (golint)
    • Line 197: warning: comment on exported method LogOptions.GetBoolDefault should be of the form "GetBoolDefault ..." (golint)
    • logger/wrap_handlers.go
    • Line 12: warning: comment on exported function FuncHandler should be of the form "FuncHandler ..." (golint)
    • Line 25: warning: comment on exported function HandlerFunc should be of the form "HandlerFunc ..." (golint)
    • Line 91: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • frevel/version.go
    • Line 30: warning: comment on exported type VersionCommand should be of the form "VersionCommand ..." (with optional leading article) (golint)
    • Line 57: warning: comment on exported method VersionCommand.UpdateConfig should be of the form "UpdateConfig ..." (golint)
    • Line 65: warning: comment on exported method VersionCommand.RunWith should be of the form "RunWith ..." (golint)
    • harness/build.go
    • Line 22: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 30: warning: exported type ByString should have comment or be unexported (golint)
    • Line 457: warning: comment on exported const RevelRunTemplate should be of the form "RevelRunTemplate ..." (golint)
    • Line 512: warning: exported const RevelMainTemplate should have comment or be unexported (golint)
    • watcher/watcher.go
    • Line 52: warning: comment on exported function NewWatcher should be of the form "NewWatcher ..." (golint)
    • Line 221: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • utils/file.go
    • Line 42: warning: comment on exported function CopyFile should be of the form "CopyFile ..." (golint)
    • Line 108: warning: comment on exported function RenderTemplate should be of the form "RenderTemplate ..." (golint)
    • Line 132: warning: comment on exported function RenderTemplateToStream should be of the form "RenderTemplateToStream ..." (golint)
    • Line 146: warning: exported function MustChmod should have comment or be unexported (golint)
    • Line 151: warning: comment on exported function PanicOnError should be of the form "PanicOnError ..." (golint)
    • Line 158: warning: comment on exported function CopyDir should be of the form "CopyDir ..." (golint)
    • Line 201: warning: comment on exported function Walk should be of the form "Walk ..." (golint)
    • Line 247: warning: comment on exported function TarGzDir should be of the form "TarGzDir ..." (golint)
    • Line 303: warning: comment on exported function Exists should be of the form "Exists ..." (golint)
    • Line 309: warning: comment on exported function Empty should be of the form "Empty ..." (golint)
    • Line 327: warning: comment on exported function FindSrcPaths should be of the form "FindSrcPaths ..." (golint)
    • Line 348: warning: error var NO_APP_FOUND should have name of the form ErrFoo (golint)
    • Line 348: warning: exported var NO_APP_FOUND should have comment or be unexported (golint)
    • Line 349: warning: error var NO_REVEL_FOUND should have name of the form ErrFoo (golint)
    • Line 349: warning: exported var NO_REVEL_FOUND should have comment or be unexported (golint)
    • model/command_config.go
    • Line 31: warning: comment on exported type COMMAND should be of the form "COMMAND ..." (with optional leading article) (golint)
    • Line 34: warning: comment on exported type CommandConfig should be of the form "CommandConfig ..." (with optional leading article) (golint)
    • Line 62: warning: comment on exported method CommandConfig.UpdateImportPath should be of the form "UpdateImportPath ..." (golint)
    • Line 229: warning: comment on exported method CommandConfig.InitPackageResolver should be of the form "InitPackageResolver ..." (golint)
    • Line 310: warning: comment on exported method CommandConfig.SetVersions should be of the form "SetVersions ..." (golint)
    • model/embedded_type_name.go
    • Line 3: warning: comment on exported type EmbeddedTypeName should be of the form "EmbeddedTypeName ..." (with optional leading article) (golint)
    • frevel/frevel.go
    • Line 31: warning: comment on exported const RevelSkeletonsImportPath should be of the form "RevelSkeletonsImportPath ..." (golint)
    • Line 55: warning: comment on exported var Commands should be of the form "Commands ..." (golint)
    • Line 113: warning: comment on exported function ParseArgs should be of the form "ParseArgs ..." (golint)
    • Line 123: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • utils/build_error.go
    • Line 11: warning: exported type BuildError should have comment or be unexported (golint)
    • Line 18: warning: comment on exported function NewBuildError should be of the form "NewBuildError ..." (golint)
    • Line 29: warning: comment on exported function NewBuildIfError should be of the form "NewBuildIfError ..." (golint)
    • Line 36: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 49: warning: comment on exported function NewCompileError should be of the form "NewCompileError ..." (golint)
    • model/method.go
    • Line 3: warning: comment on exported type MethodCall should be of the form "MethodCall ..." (with optional leading article) (golint)
    • frevel/run.go
    • Line 126: warning: don't use underscores in Go names; var revel_path should be revelPath (golint)
    • proxy/proxy.go
    • Line 12: warning: package comment is detached; there should be no blank lines between it and the package statement (golint)
    • parser2/source_processor.go
    • Line 18: warning: exported type SourceProcessor should have comment or be unexported (golint)
    • Line 29: warning: exported function ProcessSource should have comment or be unexported (golint)
    • Line 41: warning: exported function NewSourceProcessor should have comment or be unexported (golint)
    • logger/handlers.go
    • Line 8: warning: exported type LevelFilterHandler should have comment or be unexported (golint)
    • Line 13: warning: comment on exported function LevelHandler should be of the form "LevelHandler ..." (golint)
    • Line 19: warning: comment on exported method LevelFilterHandler.Log should be of the form "Log ..." (golint)
    • Line 27: warning: comment on exported function MinLevelHandler should be of the form "MinLevelHandler ..." (golint)
    • Line 35: warning: comment on exported function NotLevelHandler should be of the form "NotLevelHandler ..." (golint)
    • Line 43: warning: exported function CallerFileHandler should have comment or be unexported (golint)
    • Line 50: warning: comment on exported function CallerFuncHandler should be of the form "CallerFuncHandler ..." (golint)
    • Line 56: warning: comment on exported function MatchHandler should be of the form "MatchHandler ..." (golint)
    • Line 75: warning: comment on exported function MatchAbHandler should be of the form "MatchAbHandler ..." (golint)
    • Line 88: warning: comment on exported function NilHandler should be of the form "NilHandler ..." (golint)
    • Line 95: warning: comment on exported function MatchMapHandler should be of the form "MatchMapHandler ..." (golint)
    • Line 100: warning: comment on exported function NotMatchMapHandler should be of the form "NotMatchMapHandler ..." (golint)
    • Line 117: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 128: warning: comment on exported function NotMatchHandler should be of the form "NotMatchHandler ..." (golint)
    • Line 136: warning: exported function MultiHandler should have comment or be unexported (golint)
    • Line 161: warning: comment on exported function FilterHandler should be of the form "FilterHandler ..." (golint)
    • Line 171: warning: comment on exported type ListLogHandler should be of the form "ListLogHandler ..." (with optional leading article) (golint)
    • Line 176: warning: comment on exported function NewListLogHandler should be of the form "NewListLogHandler ..." (golint)
    • Line 201: warning: comment on exported method ListLogHandler.Del should be of the form "Del ..." (golint)
    • logger/utils.go
    • Line 20: warning: comment on exported const TEST_MODE_FLAG should be of the form "TEST_MODE_FLAG ..." (golint)
    • Line 22: warning: comment on exported const SPECIAL_USE_FLAG should be of the form "SPECIAL_USE_FLAG ..." (golint)
    • Line 26: warning: comment on exported function GetLogger should be of the form "GetLogger ..." (golint)
    • Line 76: warning: don't use underscores in Go names; var log_deprecated should be logDeprecated (golint)
    • Line 105: warning: comment on exported function NewCallStack should be of the form "NewCallStack ..." (golint)
    • model/revel_container.go
    • Line 1: warning: package comment should be of the form "Package model ..." (golint)
    • Line 16: warning: comment on exported type RevelContainer should be of the form "RevelContainer ..." (with optional leading article) (golint)
    • Line 69: warning: exported type ModuleInfo should have comment or be unexported (golint)
    • Line 74: warning: exported type WrappedRevelCallback should have comment or be unexported (golint)
    • Line 80: warning: comment on exported function NewWrappedRevelCallback should be of the form "NewWrappedRevelCallback ..." (golint)
    • Line 85: warning: comment on exported method WrappedRevelCallback.FireEvent should be of the form "FireEvent ..." (golint)
    • Line 92: warning: exported method WrappedRevelCallback.PackageResolver should have comment or be unexported (golint)
    • Line 98: warning: exported var RevelModulesImportPath should have comment or be unexported (golint)
    • Line 100: warning: comment on exported function NewRevelPaths should be of the form "NewRevelPaths ..." (golint)
    • utils/command.go
    • Line 12: warning: comment on exported function CmdInit should be of the form "CmdInit ..." (golint)
    • parser2/source_info_processor.go
    • Line 15: warning: exported type SourceInfoProcessor should have comment or be unexported (golint)
    • Line 20: warning: exported function NewSourceInfoProcessor should have comment or be unexported (golint)
    • model/version.go
    • Line 10: warning: exported type Version should have comment or be unexported (golint)
    • Line 30: warning: comment on exported function ParseVersion should be of the form "ParseVersion ..." (golint)
    • Line 37: warning: comment on exported method Version.ParseVersion should be of the form "ParseVersion ..." (golint)
    • Line 66: warning: comment on exported method Version.CompatibleFramework should be of the form "CompatibleFramework ..." (golint)
    • Line 84: warning: comment on exported method Version.MajorNewer should be of the form "MajorNewer ..." (golint)
    • Line 92: warning: comment on exported method Version.MinorNewer should be of the form "MinorNewer ..." (golint)
    • Line 103: warning: comment on exported method Version.Newer should be of the form "Newer ..." (golint)
    • Line 117: warning: comment on exported method Version.VersionString should be of the form "VersionString ..." (golint)
    • frevel/build.go
    • Line 73: warning: don't use underscores in Go names; var revel_paths should be revelPaths (golint)
    • Line 110: warning: don't use underscores in Go names; func parameter revel_paths should be revelPaths (golint)
    • Line 158: warning: don't use underscores in Go names; func parameter revel_paths should be revelPaths (golint)
    • Line 260: warning: exported const PACKAGE_RUN_SH should have comment or be unexported (golint)
    • Line 265: warning: exported const PACKAGE_RUN_BAT 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.

    • frevel/version.go
    • Line 76: warning: ineffectual assignment to needsUpdates (ineffassign)
    • Line 76: warning: ineffectual assignment to needsUpdates (ineffassign)

misspell86%

Misspell Finds commonly misspelled English words