Showing 75 of 517 total issues

Method Compiler.compileDefineAssign has 6 return statements (exceeds 4 allowed).
Open

func (c *Compiler) compileDefineAssign(
    node parser.Node,
    lhs parser.Expr,
    keyword token.Token,
    op token.Token,
Severity: Major
Found in compiler_nodes.go - About 40 mins to fix

    Method Compiler.compileCondExpr has 6 return statements (exceeds 4 allowed).
    Open

    func (c *Compiler) compileCondExpr(node *parser.CondExpr) error {
        if v, ok := node.Cond.(*parser.BoolLit); ok {
            if v.Value {
                return c.Compile(node.True)
            }
    Severity: Major
    Found in compiler_nodes.go - About 40 mins to fix

      Function canOptimizeInsts has 6 return statements (exceeds 4 allowed).
      Open

      func canOptimizeInsts(constants []Object, insts []byte) bool {
          if len(insts) == 0 {
              return false
          }
      
      
      Severity: Major
      Found in optimizer.go - About 40 mins to fix

        Function MakeInstruction has 6 return statements (exceeds 4 allowed).
        Open

        func MakeInstruction(buf []byte, op Opcode, args ...int) ([]byte, error) {
            operands := OpcodeOperands[op]
            if len(operands) != len(args) {
                return buf, fmt.Errorf(
                    "MakeInstruction: %s expected %d operands, but got %d",
        Severity: Major
        Found in compiler.go - About 40 mins to fix

          Method Compiler.compileIfStmt has 6 return statements (exceeds 4 allowed).
          Open

          func (c *Compiler) compileIfStmt(node *parser.IfStmt) error {
              // open new symbol table for the statement
              c.symbolTable = c.symbolTable.Fork(true)
              defer func() {
                  c.symbolTable = c.symbolTable.Parent(false)
          Severity: Major
          Found in compiler_nodes.go - About 40 mins to fix

            Function builtinSortFunc has 6 return statements (exceeds 4 allowed).
            Open

            func builtinSortFunc(arg Object) (ret Object, err error) {
                switch obj := arg.(type) {
                case Array:
                    sort.Slice(obj, func(i, j int) bool {
                        v, e := obj[i].BinaryOp(token.Less, obj[j])
            Severity: Major
            Found in builtins.go - About 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

                      if ch != '\r' || comment && i > len("/*") && c[i-1] == '*' &&
                          j+1 < len(b) && b[j+1] == '/' {
              Severity: Major
              Found in parser/scanner.go - About 40 mins to fix

                Function pad has 6 return statements (exceeds 4 allowed).
                Confirmed

                func pad(c ugo.Call, left bool) (ugo.Object, error) {
                    size := c.Len()
                    if size != 2 && size != 3 {
                        return ugo.Undefined,
                            ugo.ErrWrongNumArguments.NewError("want=2..3 got=" + strconv.Itoa(size))
                Severity: Major
                Found in stdlib/strings/module.go - About 40 mins to fix

                  Method Compiler.checkAssignment has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      node parser.Node,
                      lhs []parser.Expr,
                      rhs []parser.Expr,
                      keyword token.Token,
                      op token.Token,
                  Severity: Minor
                  Found in compiler_nodes.go - About 35 mins to fix

                    Method Compiler.compileDefineAssign has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        node parser.Node,
                        lhs parser.Expr,
                        keyword token.Token,
                        op token.Token,
                        allowRedefine bool,
                    Severity: Minor
                    Found in compiler_nodes.go - About 35 mins to fix

                      Method Compiler.compileDestructuring has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          node parser.Node,
                          lhs []parser.Expr,
                          tempArrSymbol *Symbol,
                          keyword token.Token,
                          op token.Token,
                      Severity: Minor
                      Found in compiler_nodes.go - About 35 mins to fix

                        Method Compiler.compileAssignStmt has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            node parser.Node,
                            lhs []parser.Expr,
                            rhs []parser.Expr,
                            keyword token.Token,
                            op token.Token,
                        Severity: Minor
                        Found in compiler_nodes.go - About 35 mins to fix

                          Method Compiler.compileImportExpr has 5 return statements (exceeds 4 allowed).
                          Open

                          func (c *Compiler) compileImportExpr(node *parser.ImportExpr) error {
                              moduleName := node.ModuleName
                              if moduleName == "" {
                                  return c.errorf(node, "empty module name")
                              }
                          Severity: Major
                          Found in compiler_nodes.go - About 35 mins to fix

                            Method VM.init has 5 return statements (exceeds 4 allowed).
                            Confirmed

                            func (vm *VM) init(globals Object, args ...Object) (Object, error) {
                                if vm.bytecode == nil || vm.bytecode.Main == nil {
                                    return nil, errors.New("invalid Bytecode")
                                }
                            
                            
                            Severity: Major
                            Found in vm.go - About 35 mins to fix

                              Method Bool.BinaryOp has 5 return statements (exceeds 4 allowed).
                              Open

                              func (o Bool) BinaryOp(tok token.Token, right Object) (Object, error) {
                                  bval := Int(0)
                                  if o {
                                      bval = Int(1)
                                  }
                              Severity: Major
                              Found in objects.go - About 35 mins to fix

                                Method Scanner.scanEscape has 5 return statements (exceeds 4 allowed).
                                Open

                                func (s *Scanner) scanEscape(quote rune) bool {
                                    offs := s.offset
                                
                                    var n int
                                    var base, max uint32
                                Severity: Major
                                Found in parser/scanner.go - About 35 mins to fix

                                  Method Compiler.compileAssignStmt has 5 return statements (exceeds 4 allowed).
                                  Open

                                  func (c *Compiler) compileAssignStmt(
                                      node parser.Node,
                                      lhs []parser.Expr,
                                      rhs []parser.Expr,
                                      keyword token.Token,
                                  Severity: Major
                                  Found in compiler_nodes.go - About 35 mins to fix

                                    Method Array.IndexGet has 5 return statements (exceeds 4 allowed).
                                    Open

                                    func (o Array) IndexGet(index Object) (Object, error) {
                                        switch v := index.(type) {
                                        case Int:
                                            idx := int(v)
                                            if idx >= 0 && idx < len(o) {
                                    Severity: Major
                                    Found in objects.go - About 35 mins to fix

                                      Method Scanner.Scan has 5 return statements (exceeds 4 allowed).
                                      Open

                                      func (s *Scanner) Scan() (
                                          tok token.Token,
                                          literal string,
                                          pos Pos,
                                      ) {
                                      Severity: Major
                                      Found in parser/scanner.go - About 35 mins to fix

                                        Method VM.xOpCallObject has 5 return statements (exceeds 4 allowed).
                                        Confirmed

                                        func (vm *VM) xOpCallObject(callee Object, numArgs, flags int) error {
                                            if !callee.CanCall() {
                                                return ErrNotCallable.NewError(callee.TypeName())
                                            }
                                        
                                        
                                        Severity: Major
                                        Found in vm.go - About 35 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language