hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Avoid deeply nested control flow statements.
Open

                        if self.esum == self.rsum:
                            return '='
                        else:
                            return 'U'
                    elif self.esum == self.rsum:
Severity: Major
Found in AppPkg/Applications/Python/Python-2.7.2/Demo/pdist/rcvs.py - About 45 mins to fix

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

        def formatline(self, line):
            words = []
            for word in re.split('(\W+)', line):
                if self.iswikiword(word):
                    if os.path.isfile(self.mkfile(word)):
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Demo/cgi/wiki.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, amt=None):
            if self._line_consumed:
                return self._file.read(amt)
            assert self._line_left
            if amt is None or amt > self._line_left:
    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

    Avoid deeply nested control flow statements.
    Open

                        if name in ("__dict__", "__weakref__"):
                            continue
                        # mangled names
                        elif name.startswith('__') and not name.endswith('__'):
                            names.append('_%s%s' % (c.__name__, name))
    Severity: Major
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/copy_reg.py - About 45 mins to fix

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

          def docclass(self, object, name=None, mod=None, funcs={}, classes={},
      Severity: Minor
      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/pydoc.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if line == "\n":
                                    after.append(line)
                                else:
                                    after.append(" " * diff + line)
                            else:
        Severity: Major
        Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/reindent.py - About 45 mins to fix

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

          def main():
              tree = {}
          
              # Check that the output directory exists
              checkopdir(pagedir)
          Severity: Minor
          Found in AppPkg/Applications/Python/Python-2.7.2/Demo/scripts/newslist.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 info has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def info(self, name_rev):
                  """Return a dictionary of info (from rlog -h) for NAME_REV
          
                  The dictionary's keys are the keywords that rlog prints
                  (e.g. 'head' and its values are the corresponding data
          Severity: Minor
          Found in AppPkg/Applications/Python/Python-2.7.2/Demo/pdist/rcslib.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 None:
                                      ans = self.__namespaces.get(aprefix)
                                  if ans is not None:
          Severity: Major
          Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xmllib.py - About 45 mins to fix

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

                def do_node(self, args):
                    self.endnode()
                    self.nodelineno = 0
                    parts = [s.strip() for s in args.split(',')]
                    while len(parts) < 4: parts.append('')
            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 findwordend has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            def findwordend(str, i, n):
                level = 0
                while i < n:
                    mo = fwprog.search(str, i)
                    if not mo:
            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

            Avoid deeply nested control flow statements.
            Open

                                    if self.nofill:
                                        self.write('\n')
                                    else:
                                        self.write('<P>\n')
                                    accu = []
            Severity: Major
            Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/texi2html.py - About 45 mins to fix

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

                  def format_all(self, files, edit=1, headers=1):
                      sec = 0
                      for file in files:
                          try:
                              entry = self.dir.open(file)
              Severity: Minor
              Found in AppPkg/Applications/Python/Python-2.7.2/Tools/faqwiz/faqwiz.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 k == 2:
                                      #print "CATEGORY",hex(i), old.table[i][k], new.table[i][k]
                                      category_changes[i] = CATEGORY_NAMES.index(value)
                                  elif k == 4:
                                      #print "BIDIR",hex(i), old.table[i][k], new.table[i][k]
              Severity: Major
              Found in AppPkg/Applications/Python/Python-2.7.2/Tools/unicode/makeunicodedata.py - About 45 mins to fix

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

                def make_double_frame(master=None, class_=None, name=None, relief=RAISED,
                                      borderwidth=1):
                    """Create a pair of frames suitable for 'hosting' a dialog."""
                    if name:
                        if class_: frame = Frame(master, class_=class_, name=name)
                Severity: Minor
                Found in AppPkg/Applications/Python/Python-2.7.2/Tools/webchecker/tktools.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 compile_dir has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def compile_dir(dir, maxlevels=10, ddir=None,
                Severity: Minor
                Found in AppPkg/Applications/Python/Python-2.7.2/Lib/compileall.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if not compile_dir(arg, maxlevels, 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

                    Avoid deeply nested control flow statements.
                    Open

                                            for t, d, nst in self.stack:
                                                if aprefix in d:
                                                    ans = d[aprefix]
                                            if ans is None:
                    Severity: Major
                    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xmllib.py - About 45 mins to fix

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

                          def __init__(self, source, want, exc_msg=None, lineno=0, indent=0,
                      Severity: Minor
                      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/doctest.py - About 45 mins to fix

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

                            def save_reduce(self, func, args, state=None,
                        Severity: Minor
                        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/pickle.py - About 45 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language