hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Avoid deeply nested control flow statements.
Open

                        for j in xrange(i-1, -1, -1):
                            jline, jlevel = stats[j]
                            if jlevel >= 0:
                                want = have + getlspace(after[jline-1]) - \
                                       getlspace(lines[jline])
Severity: Major
Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/reindent.py - About 45 mins to fix

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

    def skipfile(file):
        for p in ignore:
            if fnmatch.fnmatch(file, p): return 1
        try:
            st = os.lstat(file)
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/xxci.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 self.skip:
                                self.process(accu)
                            accu = []
    Severity: Major
    Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/texi2html.py - About 45 mins to fix

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

      def symbols(lib=PYTHONLIB,types=('T','C','D')):
      
          lines = os.popen(NM % lib).readlines()
          lines = [s.strip() for s in lines]
          symbols = {}
      Severity: Minor
      Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/nm2def.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 len(rows) == 1:
                              print "*** More than one / operator in line", rows[0]
                          else:
                              print "*** More than one / operator per statement",
                              print "in lines %d-%d" % (rows[0], rows[-1])
      Severity: Major
      Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/fixdiv.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if 'r' in mode:
                                recvfile(local, remote, name)
                        elif lmtime > rmtime:
        Severity: Major
        Found in AppPkg/Applications/Python/Python-2.7.2/Demo/pdist/cmptree.py - About 45 mins to fix

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

              def setoutput(self, spec, defs = None):
                  self.closespec()
                  self.closedefs()
                  if spec:
                      if type(spec) == StringType:
          Severity: Minor
          Found in AppPkg/Applications/Python/Python-2.7.2/Tools/bgen/bgen/scantools.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

          def main():
              import getopt
              global verbose, recurse, dryrun
              try:
                  opts, args = getopt.getopt(sys.argv[1:], "drv")
          Severity: Minor
          Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/cleanfuture.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 match has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          def match(pattern, data, vars=None):
              """Match `data' to `pattern', with variable extraction.
          
              pattern
                  Pattern to match against, possibly containing variables.
          Severity: Minor
          Found in AppPkg/Applications/Python/Python-2.7.2/Demo/parser/example.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 __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  def __init__(self, host='', port=0, local_hostname=None,
          Severity: Minor
          Found in AppPkg/Applications/Python/Python-2.7.2/Lib/smtplib.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if exclude in dirnames:
                                    dirnames.remove(exclude)
                            for filename in filenames:
            Severity: Major
            Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/pysource.py - About 45 mins to fix

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

                  def command(self, line, mo):
                      a, b = mo.span(1)
                      cmd = line[a:b]
                      args = line[b:].strip()
                      if self.debugging > 1:
              Severity: Minor
              Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/texi2html.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

              def main():
                  if len(sys.argv) > 1:
                      port = int(eval(sys.argv[1]))
                  else:
                      port = PORT
              Severity: Minor
              Found in AppPkg/Applications/Python/Python-2.7.2/Demo/sockets/rpythond.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 c == IAC:
                                      cleandata = cleandata + c
                                  elif c in (DO, DONT):
                                      if c == DO: print '(DO)',
                                      else: print '(DONT)',
              Severity: Major
              Found in AppPkg/Applications/Python/Python-2.7.2/Demo/sockets/telnet.py - About 45 mins to fix

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

                def main():
                    sys.stdout = sys.stderr
                    try:
                        opts, rest = getopt.getopt(sys.argv[1:], 'h:p:d:qvL')
                        if not rest:
                Severity: Minor
                Found in AppPkg/Applications/Python/Python-2.7.2/Demo/pdist/rrcs.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 compile_file(arg, ddir, force, rx, quiet):
                                            success = 0
                        else:
                Severity: Major
                Found in AppPkg/Applications/Python/Python-2.7.2/Lib/compileall.py - About 45 mins to fix

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

                  def clockres(timer):
                      d = {}
                      wallclock = time.time
                      start = wallclock()
                      stop = wallclock() + TEST_TIME
                  Severity: Minor
                  Found in AppPkg/Applications/Python/Python-2.7.2/Tools/pybench/clockres.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

                                          for j in xrange(i+1, len(stats)-1):
                                              jline, jlevel = stats[j]
                                              if jlevel >= 0:
                                                  if have == getlspace(lines[jline]):
                                                      want = jlevel * 4
                  Severity: Major
                  Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/reindent.py - About 45 mins to fix

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

                    def proplist(root, fn):
                        "Return a list of property names for file fn in directory root"
                        result = []
                        for path in propfiles(root, fn):
                            try:
                    Severity: Minor
                    Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/svneol.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

                    def main(args = sys.argv[1:], out=sys.stdout):
                        global fnfilter, rmode, bufsize
                        try:
                            opts, args = getopt.getopt(args, 'blts:')
                        except getopt.error, msg:
                    Severity: Minor
                    Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/md5sum.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