hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

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

    def __init__(self, SourceFile = '', TagName = '', ToolCode = '', ToolChainFamily = '', FeatureFlag = '', SupArchList = None):
Severity: Minor
Found in BaseTools/Source/Python/CommonDataClass/ModuleClass.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if fdata['filename'].endswith(ext):
                            fdata['extract-dir'] = fdata['filename'][:-len(ext)]
                            break
                replaceables = ('extract-dir', 'filename', 'url')
    Severity: Major
    Found in BaseTools/gcc/mingw-gcc-build.py - About 45 mins to fix

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

      def writefile(f,defs):
      
          f.write("entitydefs = {\n")
          items = defs.items()
          items.sort()
      Severity: Minor
      Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/parseentities.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 FullPath not in mDecFileList and File.upper().find('.DEC') > -1:
                                  mDecFileList.append(FullPath)
      
      Severity: Major
      Found in BaseTools/Source/Python/Eot/Eot.py - About 45 mins to fix

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

            def __init__(self, warp=None, calibration_runs=None, timer=None):
        
                # Set parameters
                if warp is not None:
                    self.rounds = int(self.rounds / warp)
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Tools/pybench/pybench.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 LineIndex in range(len(NewLines), LineNumber-1):
                                NewLines.append(os.linesep)
                        NewLines.append(Line)
        Severity: Major
        Found in BaseTools/Source/Python/Trim/Trim.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/PyMod-2.7.2/Lib/pydoc.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if NewVariableValue.startswith('&'):
                                    Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath, ItemName, ItemType, ItemMode, NewVariableValue[1:], GuidMacro, GuidValue, BelongsToFunction, 0)
                                    continue
                                else:
                                    EotGlobalData.gOP_UN_MATCHED.write('%s, %s, %s, %s, %s, %s\n' % (ItemType, ItemMode, SourceFileID, SourceFileFullPath, StartLine, NewParameter))
            Severity: Major
            Found in BaseTools/Source/Python/Eot/Parser.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if Protocol != NewValue and NewValue.endswith('Guid'):
                                      GuidName = GetParameterName(NewValue)
                                      Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath, ItemName, ItemType, ItemMode, GuidName, GuidMacro, GuidValue, BelongsToFunction, 0)
                                      IsFound = True
              
              Severity: Major
              Found in BaseTools/Source/Python/Eot/Parser.py - About 45 mins to fix

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

                    def MakeSymLinks(self):
                        links_dir = os.path.join(self.config.symlinks, self.config.arch)
                        if not os.path.exists(links_dir):
                            os.makedirs(links_dir)
                        startPrinted = False
                Severity: Minor
                Found in BaseTools/gcc/mingw-gcc-build.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 res is not None:
                                        errors.append(' '.join((email.strip()+': '+res.group('reason')).split()))
                                        del emails[i]
                                continue
                Severity: Major
                Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/mailerdaemon.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if FullPath not in mSourceFileList and File[-2:].upper() == '.H':
                                              mSourceFileList.append(FullPath)
                                              EotGlobalData.gOP_SOURCE_FILES.write('%s\n' % FullPath)
                                          if FullPath not in mDecFileList and File.upper().find('.DEC') > -1:
                  Severity: Major
                  Found in BaseTools/Source/Python/Eot/Eot.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        if type(fdata[replaceable]) != str: continue
                                        if replaceable in fdata:
                    Severity: Major
                    Found in BaseTools/gcc/mingw-gcc-build.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          if replaceable in fdata:
                                              fdata[replaceable] = \
                                                  fdata[replaceable].replace(
                                                      '$' + replaceItem,
                                                      fdata[replaceItem]
                      Severity: Major
                      Found in BaseTools/gcc/mingw-gcc-build.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if is_python(fullpath):
                                                yield fullpath
                                else:
                        Severity: Major
                        Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/pysource.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                              if table == "Binary":
                                                  fname = rec[0]+".bin"
                                                  open(os.path.join(dir,fname),"wb").write(bytes)
                                                  rec.append(Binary(fname))
                                              else:
                          Severity: Major
                          Found in AppPkg/Applications/Python/Python-2.7.2/Tools/msi/msilib.py - About 45 mins to fix

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

                                def __getitem__(self, key):
                                    for d in self.__d:
                                        try:
                                            value = d[key]
                                            if value:
                            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 not key in cdict:
                                                        cdict[key] = cdict[base] = modname + '.html#' + key
                                    funcs, fdict = [], {}
                            Severity: Major
                            Found in AppPkg/Applications/Python/PyMod-2.7.2/Lib/pydoc.py - About 45 mins to fix

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

                              def process(filename):
                                  try:
                                      f = open(filename, 'r')
                                  except IOError, msg:
                                      sys.stderr.write('%s: can\'t open: %s\n' % (filename, str(msg)))
                              Severity: Minor
                              Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/fixheader.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 note has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def note(self, level, msg, *args):
                                      if self.checker:
                                          apply(self.checker.note, (level, msg) + args)
                                      else:
                                          if self.verbose >= level:
                              Severity: Minor
                              Found in AppPkg/Applications/Python/Python-2.7.2/Tools/webchecker/webchecker.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