hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

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

def rewritepythondir(dir, dirprefix='', comments=1):

    mapnames = os.listdir(dir)
    for mapname in mapnames:
        if not mapname.endswith('.mapping'):
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Tools/unicode/gencodec.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 main has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Tools/i18n/msgfmt.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 'w' in mode:
                        sendfile(local, remote, name)
                else:
Severity: Major
Found in AppPkg/Applications/Python/Python-2.7.2/Demo/pdist/cmptree.py - About 45 mins to fix

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

        def getresponse(self, buffering=False):
            "Get the response from the server."
    
            # if a prior response has been completed, then forget about it.
            if self.__response and self.__response.isclosed():
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/httplib.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 _repr_iterable has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def _repr_iterable(self, x, level, left, right, maxiter, trail=''):
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/repr.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                  if filename.endswith(".py"):
                                      yield os.path.join(root, filename)
          pysource = pysource()
      Severity: Major
      Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/findnocoding.py - About 45 mins to fix

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

            def start_component(self, component = None, feature = None, flags = None, keyfile = None, uuid=None):
                """Add an entry to the Component table, and make this component the current for this
                directory. If no component name is given, the directory name is used. If no feature
                is given, the current feature is used. If no flags are given, the directory's default
                flags are used. If no keyfile is given, the KeyPath is left null in the Component
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Tools/msi/msilib.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 ans is not None:
                                    key = ans + ' ' + key
                                else:
                                    key = aprefix + ':' + key
                        nattrdict[key] = val
        Severity: Major
        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xmllib.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if not ident:
                                  print filename
                                  ident = st[:3]
                              else:
                                  if st[:3] == ident:
          Severity: Major
          Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/which.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

            Severity: Major
            Found in AppPkg/Applications/Python/Python-2.7.2/Tools/i18n/pygettext.py - About 45 mins to fix

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

              def fact(n):
                  if n < 1:
                      raise ValueError('fact() argument should be >= 1')
                  if n == 1:
                      return []  # special case
              Severity: Minor
              Found in AppPkg/Applications/Python/Python-2.7.2/Demo/scripts/fact.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 diff has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def diff(self, opts = []):
                      self.action()           # To update lseen, rseen
                      flags = ''
                      rev = self.rrev
                      # XXX should support two rev options too!
              Severity: Minor
              Found in AppPkg/Applications/Python/Python-2.7.2/Demo/pdist/rcvs.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 display has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def display(self):
                      self.nfound = self.nfound + 1
                      if self.silent:
                          return
                      print '+-' + '--'*self.n + '+'
              Severity: Minor
              Found in AppPkg/Applications/Python/Python-2.7.2/Demo/scripts/queens.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.lsum == self.rsum:
                                          return 'u'
                                      else:
                                          return 'C'
                                  if self.lsum == self.esum:
              Severity: Major
              Found in AppPkg/Applications/Python/Python-2.7.2/Demo/pdist/rcvs.py - About 45 mins to fix

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

                    def getlocalfiles(self):
                        list = self.entries.keys()
                        addlist = os.listdir(os.curdir)
                        for name in addlist:
                            if name in list:
                Severity: Minor
                Found in AppPkg/Applications/Python/Python-2.7.2/Demo/pdist/cvslib.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 convert_methods has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    def convert_methods(cls, dict):
                        """Replace functions in dict with EiffelMethod wrappers.
                
                        The dict is modified in place.
                
                Severity: Minor
                Found in AppPkg/Applications/Python/Python-2.7.2/Demo/newmetaclasses/Eiffel.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 __pow__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    def __pow__(self, n, z=None):
                        if z is not None:
                            raise TypeError, 'Complex does not support ternary pow()'
                        if IsComplex(n):
                            if n.im:
                Severity: Minor
                Found in AppPkg/Applications/Python/Python-2.7.2/Demo/classes/Complex.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 s == '00':
                                        s = '10'
                                else:
                Severity: Major
                Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/texi2html.py - About 45 mins to fix

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

                  def test():
                      import sys
                      if not sys.argv[1:] or sys.argv[1] and sys.argv[1][0] in '0123456789':
                          test_server()
                          sys.exit(0)
                  Severity: Minor
                  Found in AppPkg/Applications/Python/Python-2.7.2/Demo/pdist/RCSProxy.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 _readignore has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def _readignore(self):
                          file = self._hide('ignore')
                          try:
                              f = open(file)
                          except IOError:
                  Severity: Minor
                  Found in AppPkg/Applications/Python/Python-2.7.2/Demo/pdist/FSProxy.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

                  Severity
                  Category
                  Status
                  Source
                  Language