hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function GenSources has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def GenSources(self, ContainerFile):
        EdkLogger.debug(2, "Generate %s ..." % TAB_SOURCES)
        Sources = {}

        #
Severity: Minor
Found in BaseTools/Source/Python/Common/InfClassObject.py - About 1 hr 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 GenGuidProtocolPpis has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def GenGuidProtocolPpis(self, Type, ContainerFile):
        if ContainerFile:
            pass
        Logger.Debug(2, "Generate %s ..." % Type)
Severity: Minor
Found in BaseTools/Source/Python/UPT/PomAdapter/DecPomAlignment.py - About 1 hr 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 GenLibraryClasses has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def GenLibraryClasses(self, ContainerFile):
        EdkLogger.debug(2, "Generate %s ..." % TAB_LIBRARY_CLASSES)
        LibraryClasses = {}
        #
        # Get all LibraryClasses
Severity: Minor
Found in BaseTools/Source/Python/Common/InfClassObject.py - About 1 hr 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 InsertSectionItemsIntoDatabase has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

def InsertSectionItemsIntoDatabase(Table, FileID, Filename, Model, CurrentSection, SectionItemList, ArchList, ThirdList, IfDefList, RecordSet):
Severity: Major
Found in BaseTools/Source/Python/Common/Parsing.py - About 1 hr to fix

    Function GenBinaries has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def GenBinaries(self, ContainerFile):
            EdkLogger.debug(2, "Generate %s ..." % TAB_BINARIES)
            Binaries = {}
    
            #
    Severity: Minor
    Found in BaseTools/Source/Python/Common/InfClassObject.py - About 1 hr 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 GenPackages has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def GenPackages(self, ContainerFile):
            EdkLogger.debug(2, "Generate %s ..." % TAB_PACKAGES)
            Packages = {}
            #
            # Get all Packages
    Severity: Minor
    Found in BaseTools/Source/Python/Common/InfClassObject.py - About 1 hr 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 SplitString has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def SplitString(String):
        # There might be escaped quote: "abc\"def\\\"ghi"
        Str = String.replace('\\\\', '//').replace('\\\"', '\\\'')
        RetList = []
        InQuote = False
    Severity: Minor
    Found in BaseTools/Source/Python/Common/Expression.py - About 1 hr 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 FromXml has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def FromXml(self, Item, Key):
            if Key:
                pass
            if self.UserExtensionBinary:
                pass
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Xml/CommonXml.py - About 1 hr 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 StringItem has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def StringItem(self):
            Match1 = re.compile(self.QUOTED_PATTERN)\
                .match(self.Token[self.Index:].replace('\\\\', '//')\
                       .replace('\\\"', '\\\''))
            Match2 = re.compile(self.MACRO_PATTERN).match(self.Token[self.Index:])
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/ExpressionValidate.py - About 1 hr 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 CheckPackageExists has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def CheckPackageExists(self, Guid, Version):
            Logger.Verbose(ST.MSG_CHECK_PACKAGE_START)
            for (PkgName, PkgGuid, PkgVer, PkgPath) in self.WsPkgList:
                if PkgName or PkgPath:
                    pass
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Core/DependencyRules.py - About 1 hr 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 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, File='', Root='', AlterRoot='', Type='', IsBinary=False,
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Library/Misc.py - About 1 hr to fix

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

          def __init__(self, Name = None, Guid = None, Type = None, DatumType = None, Value = None, Token = None, MaxDatumSize = None, SkuInfoList = {}, IsOverrided = False, GuidValue = None):
      Severity: Major
      Found in BaseTools/Source/Python/Workspace/BuildClassObject.py - About 1 hr to fix

        Function BlockStart has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            def BlockStart(self):
                self._CurItems = []
                for Header in self._RawData.CurrentScope:
                    if Header in self._Headers:
                        self._LoggerError(ST.ERR_DECPARSE_UE_DUPLICATE)
        Severity: Minor
        Found in BaseTools/Source/Python/UPT/Parser/DecParser.py - About 1 hr 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 SetLibraryClass has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            def SetLibraryClass(self, LibraryClass, Comments):
                ValueList = GetSplitValueList(LibraryClass)
                Name = ValueList[0]         
                if IsValidWord(Name):
                    InfDefineLibraryItemObj = InfDefineLibraryItem()
        Severity: Minor
        Found in BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py - About 1 hr 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 MacroExtend has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            def MacroExtend (Str, MacroDict = {}, Arch = 'COMMON'):
                if Str == None :
                    return None
        
                Dict = {'$(WORKSPACE)'   : GenFdsGlobalVariable.WorkSpaceDir,
        Severity: Minor
        Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 1 hr 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 GenerateSection has 10 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def GenerateSection(Output, Input, Type=None, CompressionType=None, Guid=None,
        Severity: Major
        Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 1 hr to fix

          Function GenerateFirmwareImage has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              def GenerateFirmwareImage(Output, Input, Type="efi", SubType=None, Zero=False,
                                        Strip=False, Replace=False, TimeStamp=None, Join=False,
                                        Align=None, Padding=None, Convert=False):
                  if not GenFdsGlobalVariable.NeedsUpdate(Output, Input):
                      return
          Severity: Minor
          Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 1 hr 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 _GetDepexExpression has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              def _GetDepexExpression(self):
                  if self._DepexExpression == None:
                      self._DepexExpression = tdict(False, 2)
                      RecordList = self._RawData[MODEL_EFI_DEPEX, self._Arch]
                      DepexExpression = sdict()
          Severity: Minor
          Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 1 hr 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 __GetOptRomParams has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              def __GetOptRomParams(self):
                  
                  if self.OverrideAttribs == None:
                      self.OverrideAttribs = OptionRom.OverrideAttribs()
          
          Severity: Minor
          Found in BaseTools/Source/Python/GenFds/OptRomInfStatement.py - About 1 hr 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 a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              def __init__(self, ReportFile, ReportType):
                  self.ReportFile = ReportFile
                  if ReportFile:
                      self.ReportList = []
                      self.ReportType = []
          Severity: Minor
          Found in BaseTools/Source/Python/build/BuildReport.py - About 1 hr 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