Showing 9 of 10 total issues
Function runWrapper
has 76 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func runWrapper() js.Func {
mm := ugo.NewModuleMap().
AddBuiltinModule("time", ugotime.Module).
AddBuiltinModule("strings", ugostrings.Module).
AddBuiltinModule("fmt", ugofmt.Module).
Function runWrapper
has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring. Open
Open
func runWrapper() js.Func {
mm := ugo.NewModuleMap().
AddBuiltinModule("time", ugotime.Module).
AddBuiltinModule("strings", ugostrings.Module).
AddBuiltinModule("fmt", ugofmt.Module).
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function Gosched
has 8 return statements (exceeds 4 allowed). Open
Open
func Gosched(bc *ugo.Bytecode, callCount int64) (int, error) {
// Generate following instructions to insert before backward jumps and
// function start points.
/*
0000 CONSTANT <index>
Function linesFromError
has 6 return statements (exceeds 4 allowed). Open
Open
func linesFromError(err error) map[int][]error {
switch v := err.(type) {
case parser.ErrorList:
out := make(map[int][]error)
2: cannot find package "github.com/ozanh/ugo" in any of: Open
Open
"github.com/ozanh/ugo"
- Exclude checks
package comment is detached; there should be no blank lines between it and the package statement Open
Open
- Exclude checks
TODO found Open
Open
## TODO
- Exclude checks
FIXME found Open
Open
// FIXME
- Exclude checks
FIXME found Open
Open
// FIXME: Setting publicPath is required for worker-loader to work
- Exclude checks