hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

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

    def GetStandaloneModule(self, Guid, Version, Name, Path, DpGuid='', DpVersion=''):
Severity: Minor
Found in BaseTools/Source/Python/UPT/Core/IpiDb.py - About 45 mins to fix

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

    def CheckModuleDependFromInf(Path, DpPackagePathList):
        
        #  
        # use InfParser to parse inf, then get the information for now,
        # later on, may consider only parse to get the package dependency info 
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Core/DependencyRules.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 ObjectFactory has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def ObjectFactory(self, CName, FFE, Usage, Notify, HelpStr, IsProtocol):
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/UnitTest/CommentGeneratingUnitTest.py - About 45 mins to fix

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

      def CheckFileExist(WorkspaceDir, CheckFilename, ContainerFilename, SectionName, Line, LineNo=-1):
      Severity: Minor
      Found in BaseTools/Source/Python/UPT/Library/String.py - About 45 mins to fix

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

            def LogicalExpression(self):
                Ret = self.SpecNot()
                while self.IsCurrentOp(['||', 'OR', 'or', '&&', 'AND', 'and', 'XOR']):
                    if self.Token[self.Index-1] == '|' and self.Parens <= 0:
                        raise  _ExprError(ST.ERR_EXPR_OR)
        Severity: Minor
        Found in BaseTools/Source/Python/UPT/Library/ExpressionValidate.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 _AddStandaloneModule has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def _AddStandaloneModule(self, Guid, Version, Name, DpGuid=None, \
        Severity: Minor
        Found in BaseTools/Source/Python/UPT/Core/IpiDb.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if Dep.GetVersion() == None or \
                                  len(Dep.GetVersion()) == 0:
                                      Result = True
                                      break
                                  if Dep.GetVersion() == GuidVerPair[1]:
          Severity: Major
          Found in BaseTools/Source/Python/UPT/Core/DependencyRules.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if LineNo > Last:
                                    if License:
                                        License += EndOfLine
                                    License += Comment + EndOfLine
                                    HeaderCommentStage = HEADER_COMMENT_LICENSE                
            Severity: Major
            Found in BaseTools/Source/Python/UPT/Library/CommentParsing.py - About 45 mins to fix

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

              def GetSingleValueOfKeyFromLines(Lines, Dictionary, CommentCharacter, KeySplitCharacter, \
              Severity: Minor
              Found in BaseTools/Source/Python/UPT/Library/String.py - About 45 mins to fix

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

                    def ToXml(self, Dict, Key):
                        if self.UserExtensionBinary:
                            pass
                        BinariesNodeList = []
                        for Item in Dict:
                Severity: Minor
                Found in BaseTools/Source/Python/UPT/Xml/CommonXml.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 GuidFactory has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def GuidFactory(self, CName, FFE, Usage, GuidType, VariableName, HelpStr):           
                Severity: Minor
                Found in BaseTools/Source/Python/UPT/UnitTest/CommentGeneratingUnitTest.py - About 45 mins to fix

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

                      def _AddModuleInPackage(self, Guid, Version, Name, PkgGuid=None, \
                  Severity: Minor
                  Found in BaseTools/Source/Python/UPT/Core/IpiDb.py - About 45 mins to fix

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

                    def PrepareTest(String):
                        SectionString = StringToSectionString(String)
                        ItemList = []
                        for Item in SectionString:
                            ValueList = Item[0].split('|')
                    Severity: Minor
                    Found in BaseTools/Source/Python/UPT/UnitTest/InfBinarySectionTest.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 IsValidFeatureFlagExp has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def IsValidFeatureFlagExp(Token, Flag=False):
                        #
                        # Not do the check right now, keep the implementation for future enhancement.
                        #
                        if not Flag:
                    Severity: Minor
                    Found in BaseTools/Source/Python/UPT/Library/ExpressionValidate.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 CheckDpDepexSatisfied has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def CheckDpDepexSatisfied(self, DpObj, ReturnCode=DEPEX_CHECK_SUCCESS):
                            
                            for PkgKey in DpObj.PackageSurfaceArea.keys():
                                PkgObj = DpObj.PackageSurfaceArea[PkgKey]
                                if self.CheckPackageDepexSatisfied(PkgObj, DpObj, ReturnCode):
                    Severity: Minor
                    Found in BaseTools/Source/Python/UPT/Core/DependencyRules.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 _AddModuleDepex has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def _AddModuleDepex(self, Guid, Version, Name, Path, DepexGuid=None, \
                    Severity: Minor
                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.py - About 45 mins to fix

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

                      def ReplaceMacro(String, MacroDefinitions = None,  SelfReplacement = False, Line = None, FileName = None, Flag = False):
                      Severity: Minor
                      Found in BaseTools/Source/Python/UPT/Library/String.py - About 45 mins to fix

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

                        def ValidateValues(Key, Value, SectionName):
                            if SectionName == 'DistributionHeader':
                                Valid, Cause = ValidateRegValues(Key, Value)
                                if not Valid:
                                    return Valid, Cause
                        Severity: Minor
                        Found in BaseTools/Source/Python/UPT/Xml/IniToXml.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 GenSourceStatement has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def GenSourceStatement(SourceFile, Family, FeatureFlag, TagName=None, 
                                               ToolCode=None, HelpStr=None):
                            Statement = ''
                            if HelpStr:
                                Statement += GenGenericCommentF(HelpStr)   
                        Severity: Minor
                        Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.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 PcdExDict.has_key(Arch):
                                                PcdExDict[Arch].append(Statement)
                                            else:
                                                PcdExDict[Arch] = [Statement]
                            return GenSection('PcdEx', PcdExDict)
                        Severity: Major
                        Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py - About 45 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language