hackedteam/vector-edk

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

Summary

Maintainability
F
1 wk
Test Coverage

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

def main():
    global Options
    Options = myOptionParser()

    global Workspace
Severity: Minor
Found in BaseTools/Source/Python/GenFds/GenFds.py - About 1 day 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 GetFvBlockSize has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
Open

    def GetFvBlockSize(FvObj):
        DefaultBlockSize = 0x1
        FdObj = None
        if GenFds.OnlyGenerateThisFd != None and GenFds.OnlyGenerateThisFd.upper() in GenFdsGlobalVariable.FdfParser.Profile.FdDict.keys():
            FdObj = GenFdsGlobalVariable.FdfParser.Profile.FdDict[GenFds.OnlyGenerateThisFd.upper()]
Severity: Minor
Found in BaseTools/Source/Python/GenFds/GenFds.py - About 1 day 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

File GenFds.py has 404 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# generate flash image
#
#  Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
#
Severity: Minor
Found in BaseTools/Source/Python/GenFds/GenFds.py - About 5 hrs to fix

    Function DisplayFvSpaceInfo has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

        def DisplayFvSpaceInfo(FdfParser):
            
            FvSpaceInfoList = []
            MaxFvNameLength = 0
            for FvName in FdfParser.Profile.FvDict:
    Severity: Minor
    Found in BaseTools/Source/Python/GenFds/GenFds.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 GenFd has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

        def GenFd (OutputDir, FdfParser, WorkSpace, ArchList):
            GenFdsGlobalVariable.SetDir ('', FdfParser, WorkSpace, ArchList)
    
            GenFdsGlobalVariable.VerboseLogger(" Generate all Fd images and their required FV and Capsule images!")
            if GenFds.OnlyGenerateThisCap != None and GenFds.OnlyGenerateThisCap.upper() in GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict.keys():
    Severity: Minor
    Found in BaseTools/Source/Python/GenFds/GenFds.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

    Avoid deeply nested control flow statements.
    Open

                            if NameValue[0].strip() == 'EFI_FV_TOTAL_SIZE':
                                TotalFound = True
                                Total = NameValue[1].strip()
                            if NameValue[0].strip() == 'EFI_FV_TAKEN_SIZE':
    Severity: Major
    Found in BaseTools/Source/Python/GenFds/GenFds.py - About 45 mins to fix

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

          def PreprocessImage(BuildDb, DscFile):
              PcdDict = BuildDb.BuildObject[DscFile, 'COMMON', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag].Pcds
              PcdValue = ''
              for Key in PcdDict:
                  PcdObj = PcdDict[Key]
      Severity: Minor
      Found in BaseTools/Source/Python/GenFds/GenFds.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 NameValue[0].strip() == 'EFI_FV_SPACE_SIZE':
                                  FreeFound = True
                                  Free = NameValue[1].strip()
                      
      Severity: Major
      Found in BaseTools/Source/Python/GenFds/GenFds.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if NameValue[0].strip() == 'EFI_FV_TAKEN_SIZE':
                                    UsedFound = True
                                    Used = NameValue[1].strip()
                                if NameValue[0].strip() == 'EFI_FV_SPACE_SIZE':
        Severity: Major
        Found in BaseTools/Source/Python/GenFds/GenFds.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  for ElementRegionData in ElementRegion.RegionDataList:
                                      if ElementRegionData != None and ElementRegionData.upper() == FvObj.UiFvName:
                                          if FvObj.BlockSizeList != []:
                                              return FvObj.BlockSizeList[0][0]
                                          else:
          Severity: Major
          Found in BaseTools/Source/Python/GenFds/GenFds.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if ElementRegionData != None and ElementRegionData.upper() == FvObj.UiFvName:
                                            if FvObj.BlockSizeList != []:
                                                return FvObj.BlockSizeList[0][0]
                                            else:
                                                return ElementRegion.BlockSizeOfRegion(ElementFd.BlockSizeList)
            Severity: Major
            Found in BaseTools/Source/Python/GenFds/GenFds.py - About 45 mins to fix

              Avoid too many return statements within this function.
              Open

                                                  return ElementRegion.BlockSizeOfRegion(ElementFd.BlockSizeList)
              Severity: Major
              Found in BaseTools/Source/Python/GenFds/GenFds.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                                    return FvObj.BlockSizeList[0][0]
                Severity: Major
                Found in BaseTools/Source/Python/GenFds/GenFds.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

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

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

                                for ElementFd in GenFdsGlobalVariable.FdfParser.Profile.FdDict.values():
                                    for ElementRegion in ElementFd.RegionList:
                                        if ElementRegion.RegionType == 'FV':
                                            for ElementRegionData in ElementRegion.RegionDataList:
                                                if ElementRegionData != None and ElementRegionData.upper() == FvObj.UiFvName:
                    Severity: Major
                    Found in BaseTools/Source/Python/GenFds/GenFds.py and 1 other location - About 5 hrs to fix
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 420..427

                    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 96.

                    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

                                for ElementRegion in FdObj.RegionList:
                                        if ElementRegion.RegionType == 'FV':
                                            for ElementRegionData in ElementRegion.RegionDataList:
                                                if ElementRegionData != None and ElementRegionData.upper() == FvObj.UiFvName:
                                                    if FvObj.BlockSizeList != []:
                    Severity: Major
                    Found in BaseTools/Source/Python/GenFds/GenFds.py and 1 other location - About 5 hrs to fix
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 407..415

                    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 96.

                    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 3 locations. Consider refactoring.
                    Open

                            if (Options.uiFvName) :
                                if Options.uiFvName.upper() in FdfParserObj.Profile.FvDict.keys():
                                    GenFds.OnlyGenerateThisFv = Options.uiFvName
                                else:
                                    EdkLogger.error("GenFds", OPTION_VALUE_INVALID,
                    Severity: Major
                    Found in BaseTools/Source/Python/GenFds/GenFds.py and 2 other locations - About 2 hrs to fix
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 231..236
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 245..250

                    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 59.

                    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 3 locations. Consider refactoring.
                    Open

                            if (Options.uiFdName) :
                                if Options.uiFdName.upper() in FdfParserObj.Profile.FdDict.keys():
                                    GenFds.OnlyGenerateThisFd = Options.uiFdName
                                else:
                                    EdkLogger.error("GenFds", OPTION_VALUE_INVALID,
                    Severity: Major
                    Found in BaseTools/Source/Python/GenFds/GenFds.py and 2 other locations - About 2 hrs to fix
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 238..243
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 245..250

                    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 59.

                    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 3 locations. Consider refactoring.
                    Open

                            if (Options.uiCapName) :
                                if Options.uiCapName.upper() in FdfParserObj.Profile.CapsuleDict.keys():
                                    GenFds.OnlyGenerateThisCap = Options.uiCapName
                                else:
                                    EdkLogger.error("GenFds", OPTION_VALUE_INVALID,
                    Severity: Major
                    Found in BaseTools/Source/Python/GenFds/GenFds.py and 2 other locations - About 2 hrs to fix
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 231..236
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 238..243

                    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 59.

                    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 3 locations. Consider refactoring.
                    Open

                    def SingleCheckCallback(option, opt_str, value, parser):
                        if option not in gParamCheck:
                            setattr(parser.values, option.dest, value)
                            gParamCheck.append(option)
                        else:
                    Severity: Major
                    Found in BaseTools/Source/Python/GenFds/GenFds.py and 2 other locations - About 2 hrs to fix
                    BaseTools/Source/Python/TargetTool/TargetTool.py on lines 184..189
                    BaseTools/Source/Python/build/build.py on lines 1647..1652

                    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 57.

                    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 5 locations. Consider refactoring.
                    Open

                    if __name__ == '__main__':
                        r = main()
                        ## 0-127 is a safe return range, and 1 is a standard default error
                        if r < 0 or r > 127: r = 1
                        sys.exit(r)
                    Severity: Major
                    Found in BaseTools/Source/Python/GenFds/GenFds.py and 4 other locations - About 2 hrs to fix
                    BaseTools/Source/Python/BPDG/BPDG.py on lines 153..157
                    BaseTools/Source/Python/Trim/Trim.py on lines 604..608
                    BaseTools/Source/Python/UPT/UPT.py on lines 232..239
                    BaseTools/Source/Python/build/build.py on lines 1901..1905

                    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 52.

                    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 3 locations. Consider refactoring.
                    Open

                                            if NameValue[0].strip() == 'EFI_FV_SPACE_SIZE':
                                                FreeFound = True
                                                Free = NameValue[1].strip()
                    Severity: Major
                    Found in BaseTools/Source/Python/GenFds/GenFds.py and 2 other locations - About 1 hr to fix
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 454..456
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 457..459

                    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 40.

                    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 3 locations. Consider refactoring.
                    Open

                                            if NameValue[0].strip() == 'EFI_FV_TAKEN_SIZE':
                                                UsedFound = True
                                                Used = NameValue[1].strip()
                    Severity: Major
                    Found in BaseTools/Source/Python/GenFds/GenFds.py and 2 other locations - About 1 hr to fix
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 454..456
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 460..462

                    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 40.

                    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 3 locations. Consider refactoring.
                    Open

                                            if NameValue[0].strip() == 'EFI_FV_TOTAL_SIZE':
                                                TotalFound = True
                                                Total = NameValue[1].strip()
                    Severity: Major
                    Found in BaseTools/Source/Python/GenFds/GenFds.py and 2 other locations - About 1 hr to fix
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 457..459
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 460..462

                    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 40.

                    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

                                    for CapsuleName in GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict.keys():
                                        CapsuleObj = GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict[CapsuleName]
                                        CapsuleObj.GenCapsule()
                    Severity: Major
                    Found in BaseTools/Source/Python/GenFds/GenFds.py and 1 other location - About 1 hr to fix
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 363..366

                    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 40.

                    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

                            elif GenFds.OnlyGenerateThisFd == None and GenFds.OnlyGenerateThisFv == None:
                                for FdName in GenFdsGlobalVariable.FdfParser.Profile.FdDict.keys():
                                    FdObj = GenFdsGlobalVariable.FdfParser.Profile.FdDict[FdName]
                                    FdObj.GenFd()
                    Severity: Major
                    Found in BaseTools/Source/Python/GenFds/GenFds.py and 1 other location - About 1 hr to fix
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 386..388

                    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 40.

                    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 4 locations. Consider refactoring.
                    Open

                            if GenFds.OnlyGenerateThisFd != None and GenFds.OnlyGenerateThisFd.upper() in GenFdsGlobalVariable.FdfParser.Profile.FdDict.keys():
                    Severity: Major
                    Found in BaseTools/Source/Python/GenFds/GenFds.py and 3 other locations - About 50 mins to fix
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 352..352
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 358..358
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 369..369

                    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 36.

                    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 4 locations. Consider refactoring.
                    Open

                            if GenFds.OnlyGenerateThisFv != None and GenFds.OnlyGenerateThisFv.upper() in GenFdsGlobalVariable.FdfParser.Profile.FvDict.keys():
                    Severity: Major
                    Found in BaseTools/Source/Python/GenFds/GenFds.py and 3 other locations - About 50 mins to fix
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 352..352
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 358..358
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 404..404

                    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 36.

                    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 4 locations. Consider refactoring.
                    Open

                            if GenFds.OnlyGenerateThisCap != None and GenFds.OnlyGenerateThisCap.upper() in GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict.keys():
                    Severity: Major
                    Found in BaseTools/Source/Python/GenFds/GenFds.py and 3 other locations - About 50 mins to fix
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 358..358
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 369..369
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 404..404

                    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 36.

                    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 4 locations. Consider refactoring.
                    Open

                            if GenFds.OnlyGenerateThisFd != None and GenFds.OnlyGenerateThisFd.upper() in GenFdsGlobalVariable.FdfParser.Profile.FdDict.keys():
                    Severity: Major
                    Found in BaseTools/Source/Python/GenFds/GenFds.py and 3 other locations - About 50 mins to fix
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 352..352
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 369..369
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 404..404

                    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 36.

                    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 os.path.normcase (FdfFilename).find(Workspace) != 0:
                                    EdkLogger.error("GenFds", FILE_NOT_FOUND, "FdfFile doesn't exist in Workspace!")
                    Severity: Minor
                    Found in BaseTools/Source/Python/GenFds/GenFds.py and 1 other location - About 45 mins to fix
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 137..138

                    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 35.

                    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 os.path.normcase (ActivePlatform).find(Workspace) != 0:
                                    EdkLogger.error("GenFds", FILE_NOT_FOUND, "ActivePlatform doesn't exist in Workspace!")
                    Severity: Minor
                    Found in BaseTools/Source/Python/GenFds/GenFds.py and 1 other location - About 45 mins to fix
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 106..107

                    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 35.

                    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 List[0].strip() == "EFI_SOURCE":
                                            GlobalData.gEfiSource = List[1].strip()
                                            GlobalData.gGlobalDefines["EFI_SOURCE"] = GlobalData.gEfiSource
                                            continue
                    Severity: Minor
                    Found in BaseTools/Source/Python/GenFds/GenFds.py and 1 other location - About 40 mins to fix
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 166..169

                    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 34.

                    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

                                        elif List[0].strip() == "EDK_SOURCE":
                                            GlobalData.gEdkSource = List[1].strip()
                                            GlobalData.gGlobalDefines["EDK_SOURCE"] = GlobalData.gEdkSource
                                            continue
                    Severity: Minor
                    Found in BaseTools/Source/Python/GenFds/GenFds.py and 1 other location - About 40 mins to fix
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 162..165

                    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 34.

                    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 3 locations. Consider refactoring.
                    Open

                                        elif List[0].strip() in ["WORKSPACE", "TARGET", "TOOLCHAIN"]:
                                            GlobalData.gGlobalDefines[List[0].strip()] = List[1].strip()
                    Severity: Minor
                    Found in BaseTools/Source/Python/GenFds/GenFds.py and 2 other locations - About 35 mins to fix
                    BaseTools/Source/Python/Common/FdfParserLite.py on lines 2697..2697
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 170..173

                    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 33.

                    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 3 locations. Consider refactoring.
                    Open

                                if not os.path.isabs (ActivePlatform):
                                    ActivePlatform = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, ActivePlatform)
                    Severity: Minor
                    Found in BaseTools/Source/Python/GenFds/GenFds.py and 2 other locations - About 30 mins to fix
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 102..103
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 204..205

                    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

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

                                if not os.path.isabs (OutputDirFromCommandLine):
                                    OutputDirFromCommandLine = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, OutputDirFromCommandLine)
                    Severity: Minor
                    Found in BaseTools/Source/Python/GenFds/GenFds.py and 2 other locations - About 30 mins to fix
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 102..103
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 131..132

                    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

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

                                if not os.path.isabs (FdfFilename):
                                    FdfFilename = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, FdfFilename)
                    Severity: Minor
                    Found in BaseTools/Source/Python/GenFds/GenFds.py and 2 other locations - About 30 mins to fix
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 131..132
                    BaseTools/Source/Python/GenFds/GenFds.py on lines 204..205

                    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