hackedteam/vector-edk

View on GitHub
BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py

Summary

Maintainability
F
1 wk
Test Coverage

File GenFdsGlobalVariable.py has 534 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# Global variables for GenFds
#
#  Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
#
Severity: Major
Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 1 day to fix

    Function GetModuleCodaTargetList has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
    Open

        def GetModuleCodaTargetList(Inf, Arch):
            BuildRules = GenFdsGlobalVariable.GetBuildRules(Inf, Arch)
            if not BuildRules:
                return []
    
    Severity: Minor
    Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 6 hrs 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 GetPcdValue has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
    Open

        def GetPcdValue (PcdPattern):
            if PcdPattern == None :
                return None
            PcdPair = PcdPattern.lstrip('PCD(').rstrip(')').strip().split('.')
            TokenSpace = PcdPair[0]
    Severity: Minor
    Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 5 hrs 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 a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        def GenerateSection(Output, Input, Type=None, CompressionType=None, Guid=None,
                            GuidHdrLen=None, GuidAttr=[], Ui=None, Ver=None, InputAlign=None, BuildNumber=None):
            Cmd = ["GenSec"]
            if Type not in [None, '']:
                Cmd += ["-s", Type]
    Severity: Minor
    Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 3 hrs 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 GetBuildRules has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        def GetBuildRules(Inf, Arch):
            if not Arch:
                Arch = 'COMMON'
    
            if not Arch in GenFdsGlobalVariable.OutputDirDict:
    Severity: Minor
    Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 3 hrs 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 __LoadBuildRule has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        def __LoadBuildRule():
            if GenFdsGlobalVariable.__BuildRuleDatabase:
                return GenFdsGlobalVariable.__BuildRuleDatabase
            BuildConfigurationFile = os.path.normpath(os.path.join(GenFdsGlobalVariable.WorkSpaceDir, "Conf/target.txt"))
            TargetTxt = TargetTxtClassObject()
    Severity: Minor
    Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 2 hrs 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

    GenFdsGlobalVariable has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class GenFdsGlobalVariable:
        FvDir = ''
        OutputDirDict = {}
        BinDir = ''
        # will be FvDir + os.sep + 'Ffs'
    Severity: Minor
    Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 2 hrs to fix

      Function GenerateOptionRom has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def GenerateOptionRom(Output, EfiInput, BinaryInput, Compress=False, ClassCode=None,
                              Revision=None, DeviceId=None, VendorId=None):
              InputList = []   
              Cmd = ["EfiRom"]
              if len(EfiInput) > 0:
      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 CallExternalTool has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def CallExternalTool (cmd, errorMess, returnValue=[]):
      
              if type(cmd) not in (tuple, list):
                  GenFdsGlobalVariable.ErrorLogger("ToolError!  Invalid parameter type in call to CallExternalTool")
      
      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 GenerateFirmwareImage has 11 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def GenerateFirmwareImage(Output, Input, Type="efi", SubType=None, Zero=False,
      Severity: Major
      Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 1 hr to fix

        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 GetBuildRules has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def GetBuildRules(Inf, Arch):
                  if not Arch:
                      Arch = 'COMMON'
          
                  if not Arch in GenFdsGlobalVariable.OutputDirDict:
          Severity: Minor
          Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 1 hr to fix

            Function GenerateFirmwareVolume has 9 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def GenerateFirmwareVolume(Output, Input, BaseAddress=None, ForceRebase=None, Capsule=False, Dump=False,
            Severity: Major
            Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 1 hr to fix

              Function GenerateFirmwareVolume has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def GenerateFirmwareVolume(Output, Input, BaseAddress=None, ForceRebase=None, Capsule=False, Dump=False,
                                             AddressFile=None, MapFile=None, FfsList=[], FileSystemGuid=None):
                      if not GenFdsGlobalVariable.NeedsUpdate(Output, Input+FfsList):
                          return
                      GenFdsGlobalVariable.DebugLogger(EdkLogger.DEBUG_5, "%s needs update because of newer %s" % (Output, Input))
              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 SetDir has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  def SetDir (OutputDir, FdfParser, WorkSpace, ArchList):
                      GenFdsGlobalVariable.VerboseLogger( "GenFdsGlobalVariable.OutputDir :%s" %OutputDir)
              #        GenFdsGlobalVariable.OutputDirDict = OutputDir
                      GenFdsGlobalVariable.FdfParser = FdfParser
                      GenFdsGlobalVariable.WorkSpace = WorkSpace
              Severity: Minor
              Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 55 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 NeedsUpdate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  def NeedsUpdate(Output, Input):
                      if not os.path.exists(Output):
                          return True
                      # always update "Output" if no "Input" given
                      if Input == None or len(Input) == 0:
              Severity: Minor
              Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 55 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 GenerateFfs has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def GenerateFfs(Output, Input, Type, Guid, Fixed=False, CheckSum=False, Align=None,
              Severity: Major
              Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 50 mins to fix

                Function GenerateOptionRom has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def GenerateOptionRom(Output, EfiInput, BinaryInput, Compress=False, ClassCode=None,
                Severity: Major
                Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 50 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if PcdObj.Type != 'FixedAtBuild':
                                              EdkLogger.error("GenFds", GENFDS_ERROR, "%s is not FixedAtBuild type." % PcdPattern)
                                          if PcdObj.DatumType != 'VOID*':
                  Severity: Major
                  Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if PcdObj.DatumType != 'VOID*':
                                                EdkLogger.error("GenFds", GENFDS_ERROR, "%s is not VOID* datum type." % PcdPattern)
                                                
                    Severity: Major
                    Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 45 mins to fix

                      Function GenerateFfs has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def GenerateFfs(Output, Input, Type, Guid, Fixed=False, CheckSum=False, Align=None,
                                          SectionAlign=None):
                              Cmd = ["GenFfs", "-t", Type, "-g", Guid]
                              if Fixed == True:
                                  Cmd += ["-x"]
                      Severity: Minor
                      Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 35 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 too many return statements within this function.
                      Open

                                      return True
                      Severity: Major
                      Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return False
                        Severity: Major
                        Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 30 mins to fix

                          Identical blocks of code found in 2 locations. Consider refactoring.
                          Open

                                      for Key in PcdDict:
                                          PcdObj = PcdDict[Key]
                                          if (PcdObj.TokenCName == TokenCName) and (PcdObj.TokenSpaceGuidCName == TokenSpace):
                                              if PcdObj.Type != 'FixedAtBuild':
                                                  EdkLogger.error("GenFds", GENFDS_ERROR, "%s is not FixedAtBuild type." % PcdPattern)
                          Severity: Major
                          Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py and 1 other location - About 7 hrs to fix
                          BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py on lines 701..710

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 110.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Identical blocks of code found in 2 locations. Consider refactoring.
                          Open

                                          for Key in PcdDict:
                                              PcdObj = PcdDict[Key]
                                              if (PcdObj.TokenCName == TokenCName) and (PcdObj.TokenSpaceGuidCName == TokenSpace):
                                                  if PcdObj.Type != 'FixedAtBuild':
                                                      EdkLogger.error("GenFds", GENFDS_ERROR, "%s is not FixedAtBuild type." % PcdPattern)
                          Severity: Major
                          Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py and 1 other location - About 7 hrs to fix
                          BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py on lines 685..694

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 110.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                                          if DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY in ToolDefinition \
                                             and GenFdsGlobalVariable.ToolChainTag in ToolDefinition[DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY] \
                                             and ToolDefinition[DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY][GenFdsGlobalVariable.ToolChainTag]:
                                              GenFdsGlobalVariable.BuildRuleFamily = ToolDefinition[DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY][GenFdsGlobalVariable.ToolChainTag]
                          Severity: Major
                          Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py and 1 other location - About 3 hrs to fix
                          BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py on lines 111..114

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 73.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                                          if DataType.TAB_TOD_DEFINES_FAMILY in ToolDefinition \
                                             and GenFdsGlobalVariable.ToolChainTag in ToolDefinition[DataType.TAB_TOD_DEFINES_FAMILY] \
                                             and ToolDefinition[DataType.TAB_TOD_DEFINES_FAMILY][GenFdsGlobalVariable.ToolChainTag]:
                                              GenFdsGlobalVariable.ToolChainFamily = ToolDefinition[DataType.TAB_TOD_DEFINES_FAMILY][GenFdsGlobalVariable.ToolChainTag]
                          Severity: Major
                          Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py and 1 other location - About 3 hrs to fix
                          BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py on lines 106..109

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 73.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                                          if not RuleObject:
                                              # build type is always module type, but ...
                                              if Inf.ModuleType != Inf.BuildType:
                                                  RuleObject = BuildRuleDatabase[Type, Inf.ModuleType, Arch, GenFdsGlobalVariable.ToolChainFamily]
                          Severity: Major
                          Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py and 1 other location - About 1 hr to fix
                          BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py on lines 171..174

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 42.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                                      if not RuleObject:
                                          # build type is always module type, but ...
                                          if Inf.ModuleType != Inf.BuildType:
                                              RuleObject = BuildRuleDatabase[Type, Inf.ModuleType, Arch, GenFdsGlobalVariable.BuildRuleFamily]
                          Severity: Major
                          Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py and 1 other location - About 1 hr to fix
                          BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py on lines 178..181

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 42.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                                          if File.IsBinary and File == Source and Inf.Binaries != None and File in Inf.Binaries:
                          Severity: Minor
                          Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py and 1 other location - About 30 mins to fix
                          BaseTools/Source/Python/AutoGen/AutoGen.py on lines 2506..2506

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 32.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          There are no issues that match your filters.

                          Category
                          Status