hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Avoid deeply nested control flow statements.
Open

                        if optval is not None:
                            if vi in ('=', ':') and ';' in optval:
                                # ';' is a comment delimiter only if it follows
                                # a spacing character
                                pos = optval.find(';')
Severity: Major
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/ConfigParser.py - About 45 mins to fix

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

        def __init__(self, fixer_names, options=None, explicit=None):
            """Initializer.
    
            Args:
                fixer_names: a list of fixers to import
    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 results:
                                new = fixer.transform(node, results)
                                if new is not None:
                                    node.replace(new)
                                    #new.fixers_applied.append(fixer)
    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 line in diff_lines:
                                      print line
                                  sys.stdout.flush()
      Severity: Major
      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/main.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 AppPkg/Applications/Python/Python-2.7.2/Lib/ConfigParser.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if isinstance(stmt, pytree.Node):
                                      break
          
                              # The assignment is different if old_N is a tuple or list
                              # In that case, the assignment is old_N = new_N.args
          Severity: Major
          Found in AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/fixes/fix_except.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if os.path.isfile(os.path.join(path, "__init__.py")):
                                        # This is a package directory, add it
                                        self.writepy(path, basename)  # Recursive call
                                elif ext == ".py":
            Severity: Major
            Found in AppPkg/Applications/Python/Python-2.7.2/Lib/zipfile.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if reductor:
                                      rv = reductor(2)
                                  else:
                                      reductor = getattr(x, "__reduce__", None)
                                      if reductor:
              Severity: Major
              Found in AppPkg/Applications/Python/Python-2.7.2/Lib/copy.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        for fixer in current_ac_node.fixers:
                                            if not fixer in results.keys():
                                                results[fixer] = []
                                            results[fixer].append(current_ast_node)
                
                Severity: Major
                Found in AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/btm_matcher.py - About 45 mins to fix

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

                  def ToASCII(label):
                      try:
                          # Step 1: try ASCII
                          label = label.encode("ascii")
                      except UnicodeError:
                  Severity: Minor
                  Found in AppPkg/Applications/Python/Python-2.7.2/Lib/encodings/idna.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 transform has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def transform(self, node, results):
                          head = results["head"]
                          method = results["method"][0] # Extract node for method name
                          tail = results["tail"]
                          syms = self.syms
                  Severity: Minor
                  Found in AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/fixes/fix_dict.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 _extract_member has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def _extract_member(self, member, targetpath, pwd):
                          """Extract the ZipInfo object 'member' to a physical
                             file on the path targetpath.
                          """
                          # build the destination pathname, replacing
                  Severity: Minor
                  Found in AppPkg/Applications/Python/Python-2.7.2/Lib/zipfile.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 read has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def read(self, n=-1):
                          """Read and return up to n bytes.
                          If the argument is omitted, None, or negative, data is read and returned until EOF is reached..
                          """
                          buf = ''
                  Severity: Minor
                  Found in AppPkg/Applications/Python/Python-2.7.2/Lib/zipfile.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 insertion_sort has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  Severity: Minor
                  Found in AppPkg/Applications/Python/Python-2.7.2/Lib/encodings/punycode.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 self.debug:
                                              print "Adding", arcname
                                          self.write(fname, arcname)
                  Severity: Major
                  Found in AppPkg/Applications/Python/Python-2.7.2/Lib/zipfile.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if self.debug:
                                                print "Adding", arcname
                                            self.write(fname, arcname)
                    Severity: Major
                    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/zipfile.py - About 45 mins to fix

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

                      def rec_test(sequence, test_func):
                          """Tests test_func on all items of sequence and items of included
                          sub-iterables"""
                          for x in sequence:
                              if isinstance(x, (list, tuple)):
                      Severity: Minor
                      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/btm_utils.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 not fixer in results:
                                                  results[fixer] = []
                                              results[fixer].append(current_ast_node)
                      Severity: Major
                      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/btm_matcher.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if member_name in change[1]:
                                                    if change[0] not in mod_dict:
                                                        modules.append(change[0])
                                                    mod_dict.setdefault(change[0], []).append(member)
                        
                        Severity: Major
                        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/fixes/fix_urllib.py - About 45 mins to fix

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

                          def fixup_parse_tree(cls_node):
                              """ one-line classes don't get a suite in the parse tree so we add
                                  one to normalize the tree
                              """
                              for node in cls_node.children:

                          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

                          Severity
                          Category
                          Status
                          Source
                          Language