hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Avoid deeply nested control flow statements.
Open

                        if node in match_set[fixer]:
                            match_set[fixer].remove(node)
Severity: Major
Found in vector-uefi/fd/efi/StdLib/lib/python.27/lib2to3/refactor.py - About 45 mins to fix

    Function show has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def show(caps):
        print "Mailcap files:"
        for fn in listmailcapfiles(): print "\t" + fn
        print
        if not caps: caps = getcaps()
    Severity: Minor
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/mailcap.py - About 45 mins to fix

    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

    Avoid deeply nested control flow statements.
    Open

                        if token[-1] == '\n':                  # continued string
                            strstart = (lnum, start)
                            endprog = (endprogs[initial] or endprogs[token[1]] or
                                       endprogs[token[2]])
                            contstr, needcont = line[start:], 1
    Severity: Major
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/tokenize.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if child.children[2].value == name:
                              return node
                      elif child.type == token.NAME and child.value == name:
      Severity: Major
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/lib2to3/fixer_util.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if endmatch:                           # all on one line
                                pos = endmatch.end(0)
                                token = line[start:pos]
                                yield (STRING, token, spos, (lnum, pos), line)
                            else:
        Severity: Major
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/lib2to3/pgen2/tokenize.py - About 45 mins to fix

          Function _interpolate_some has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def _interpolate_some(self, option, accum, rest, section, map, depth):
          Severity: Minor
          Found in vector-uefi/fd/efi/StdLib/lib/python.27/ConfigParser.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if not e:
                                        e = ParsingError(fpname)
                                    e.append(lineno, repr(line))
            Severity: Major
            Found in vector-uefi/fd/efi/StdLib/lib/python.27/ConfigParser.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if node.fixers_applied and fixer in node.fixers_applied:
                                          # do not apply the same fixer again
                                          continue
              
              Severity: Major
              Found in vector-uefi/fd/efi/StdLib/lib/python.27/lib2to3/refactor.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if endmatch:                           # all on one line
                                        pos = endmatch.end(0)
                                        token = line[start:pos]
                                        yield (STRING, token, spos, (lnum, pos), line)
                                    else:
                Severity: Major
                Found in vector-uefi/fd/efi/StdLib/lib/python.27/tokenize.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if not self.stack:
                                              # Done parsing!
                                              return True
                                          dfa, state, node = self.stack[-1]
                  Severity: Major
                  Found in vector-uefi/fd/efi/StdLib/lib/python.27/lib2to3/pgen2/parse.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            for state in dfa:
                                                state.unifystate(state_j, state_i)
                                            changes = True
                    Severity: Major
                    Found in vector-uefi/fd/efi/StdLib/lib/python.27/lib2to3/pgen2/pgen.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                      Severity: Major
                      Found in vector-uefi/fd/efi/StdLib/lib/python.27/shlex.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if initial in '([{':
                                                parenlev += 1
                                            elif initial in ')]}':
                                                parenlev -= 1
                                            yield (OP, token, spos, epos, line)
                        Severity: Major
                        Found in vector-uefi/fd/efi/StdLib/lib/python.27/tokenize.py - About 45 mins to fix

                          Function refactor has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def refactor(self, items, write=False, doctests_only=False,
                                           num_processes=1):
                                  if num_processes == 1:
                                      return super(MultiprocessRefactoringTool, self).refactor(
                                          items, write, doctests_only)
                          Severity: Minor
                          Found in vector-uefi/fd/efi/StdLib/lib/python.27/lib2to3/refactor.py - About 45 mins to fix

                          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

                          Avoid deeply nested control flow statements.
                          Open

                                              if token[-1] == '\n':                  # continued string
                                                  strstart = (lnum, start)
                                                  endprog = (endprogs[initial] or endprogs[token[1]] or
                                                             endprogs[token[2]])
                                                  contstr, needcont = line[start:], 1
                          Severity: Major
                          Found in vector-uefi/fd/efi/StdLib/lib/python.27/lib2to3/pgen2/tokenize.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                if initial in '([{': parenlev = parenlev + 1
                                                elif initial in ')]}': parenlev = parenlev - 1
                                                yield (OP, token, spos, epos, line)
                            Severity: Major
                            Found in vector-uefi/fd/efi/StdLib/lib/python.27/lib2to3/pgen2/tokenize.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                  if kid.type == token.COLON and kid.value == ":":
                                                      # i+3 is the colon, i+4 is the suite
                                                      n = find_binding(name, make_suite(child.children[i+4]), package)
                                                      if n: ret = n
                                      elif child.type in _def_syms and child.children[1].value == name:
                              Severity: Major
                              Found in vector-uefi/fd/efi/StdLib/lib/python.27/lib2to3/fixer_util.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if results:
                                                            new = fixer.transform(node, results)
                                                            if new is not None:
                                                                node.replace(new)
                                                                #new.fixers_applied.append(fixer)
                                Severity: Major
                                Found in vector-uefi/fd/efi/StdLib/lib/python.27/lib2to3/refactor.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                              for line in diff_lines:
                                                                  print line
                                                              sys.stdout.flush()
                                  Severity: Major
                                  Found in vector-uefi/fd/efi/StdLib/lib/python.27/lib2to3/main.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                        if parenlev > 0:
                                                            newline = NL
                                                        yield (newline, token, spos, epos, line)
                                    Severity: Major
                                    Found in vector-uefi/fd/efi/StdLib/lib/python.27/lib2to3/pgen2/tokenize.py - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language