hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Avoid deeply nested control flow statements.
Open

                        if ((v[1]/total) >= consistency and
                            (delimiters is None or k in delimiters)):
                            delims[k] = v
                consistency -= 0.01
Severity: Major
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/csv.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 AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/refactor.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              for c1, r1 in generate_matches(alt, nodes[c0:]):
                                  if c1 > 0:
                                      r = {}
                                      r.update(r0)
                                      r.update(r1)
      Severity: Major
      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/pytree.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 AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/pgen2/tokenize.py - About 45 mins to fix

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

              def refactor_stdin(self, doctests_only=False):
                  input = sys.stdin.read()
                  if doctests_only:
                      self.log_debug("Refactoring doctests in stdin")
                      output = self.refactor_docstring(input, "<stdin>")
          Severity: Minor
          Found in AppPkg/Applications/Python/Python-2.7.2/Lib/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 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 AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/pgen2/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 AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/pgen2/parse.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 AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/pgen2/tokenize.py - About 45 mins to fix

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

                def is_probably_builtin(node):
                    """
                    Check that something isn't an attribute or function name etc.
                    """
                    prev = node.prev_sibling
                Severity: Minor
                Found in AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/fixer_util.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

                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 AppPkg/Applications/Python/Python-2.7.2/Lib/ConfigParser.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if node in match_set[fixer]:
                                              match_set[fixer].remove(node)
                  
                  Severity: Major
                  Found in AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/refactor.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 AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/pgen2/pgen.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 AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/fixer_util.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 AppPkg/Applications/Python/Python-2.7.2/Lib/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 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 AppPkg/Applications/Python/Python-2.7.2/Lib/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 AppPkg/Applications/Python/Python-2.7.2/Lib/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 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 AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/fixer_util.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                            Severity: Major
                            Found in AppPkg/Applications/Python/Python-2.7.2/Lib/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 AppPkg/Applications/Python/Python-2.7.2/Lib/tokenize.py - About 45 mins to fix

                                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 AppPkg/Applications/Python/Python-2.7.2/Lib/tokenize.py - About 45 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language