hackedteam/vector-edk

View on GitHub
BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py

Summary

Maintainability
F
1 wk
Test Coverage

File InfPomAlignment.py has 610 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file InfPomAlignment.py
# This file contained the adapter for convert INF parser object to POM Object
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
#
Severity: Major
Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py - About 1 day to fix

    Function _GenDepexes has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
    Open

        def _GenDepexes(self):
            Logger.Debug(2, "Generate %s ..." % DT.TAB_DEPEX)
    
            PEI_LIST = [DT.SUP_MODULE_PEIM]
            SMM_LIST = [DT.SUP_MODULE_DXE_SMM_DRIVER]
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.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 _GenModuleHeader has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

        def _GenModuleHeader(self):
            Logger.Debug(2, "Generate ModuleHeader ...")
            #
            # Get all defines information form InfParser Object
            #
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py - About 4 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 _GenSpecialComments has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def _GenSpecialComments(self):
            SpecialCommentsList = self.Parser.InfSpecialCommentSection.GetSpecialComments()
            for Key in SpecialCommentsList:
                if Key == DT.TYPE_HOB_SECTION:
                    HobList = []
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.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 _GenGuidProtocolPpis has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

        def _GenGuidProtocolPpis(self, Type):
            Logger.Debug(2, "Generate %s ..." % Type)
            #
            # Get all Guid/Protocol/Ppis data
            #
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.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 _GenPcds has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def _GenPcds(self):
            if not GlobalData.gIS_BINARY_INF:
                Logger.Debug(2, "Generate %s ..." % DT.TAB_PCDS)
    
                #
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.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 _GenBinaries has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def _GenBinaries(self):
            Logger.Debug(2, "Generate %s ..." % DT.TAB_BINARIES)
            BinariesDict = {}
    
            #
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.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 _GenAsBuiltPcds has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def _GenAsBuiltPcds(self, PcdList, AsBuildIns):
            AsBuildPatchPcdList = []
            AsBuildPcdExList = []
            #
            # Pcd AsBuild Info
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.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 _GenModuleHeader has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def _GenModuleHeader(self):
            Logger.Debug(2, "Generate ModuleHeader ...")
            #
            # Get all defines information form InfParser Object
            #
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py - About 1 hr to fix

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

          def _GenLibraryClasses(self):
              Logger.Debug(2, "Generate %s ..." % DT.TAB_LIBRARY_CLASSES)
              if not GlobalData.gIS_BINARY_INF:
                  #
                  # Get all LibraryClasses
      Severity: Minor
      Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.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 _GenBuildOptions has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def _GenBuildOptions(self):
              Logger.Debug(2, "Generate %s ..." % DT.TAB_BUILD_OPTIONS)
              #
              # Get all BuildOptions
              #
      Severity: Minor
      Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.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 _GenUserExtensions has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def _GenUserExtensions(self):
              #
              # UserExtensions
              #
              UserExtensionObj = self.Parser.InfUserExtensionSection.UserExtension
      Severity: Minor
      Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.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

      Avoid deeply nested control flow statements.
      Open

                              for CommentItem in CommentList:
                                  Pcd = CommonObject.PcdObject()
                                  Pcd.SetCName(PcdItemObj.GetCName())
                                  Pcd.SetTokenSpaceGuidCName(PcdItemObj.GetTokenSpaceGuidCName())
                                  Pcd.SetDefaultValue(PcdItemObj.GetDefaultValue())
      Severity: Major
      Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if ModuleTypeInList in DT.VALID_DEPEX_MODULE_TYPE_LIST:
                                    ModuleTypeList.append(ModuleTypeInList)
                        if not ModuleTypeList:
        Severity: Major
        Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py - About 45 mins to fix

          Function _GenPackages has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def _GenPackages(self, Skip):
                  Logger.Debug(2, "Generate %s ..." % DT.TAB_PACKAGES)
                  #
                  # Get all Packages
                  #
          Severity: Minor
          Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py - About 25 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

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

                  elif Type == DT.TAB_PROTOCOLS:
                      ProtocolData = ProtocolObj.keys()
                      for Item in ProtocolData:
                          CommentList = Item.GetCommentList()
                          for CommentItem in CommentList:
          Severity: Major
          Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py and 1 other location - About 1 day to fix
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 939..954

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

          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 Type == DT.TAB_PPIS:
                      PpiData = PpisObj.keys()
                      for Item in PpiData:
                          CommentList = Item.GetCommentList()
                          for CommentItem in CommentList:
          Severity: Major
          Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py and 1 other location - About 1 day to fix
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 923..938

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

          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 Key == DT.TYPE_BOOTMODE_SECTION:
                          BootModeList = []
                          for Item in SpecialCommentsList[Key]:
                              BootMode = BootModeObject()
                              BootMode.SetSupportedBootModes(Item.GetSupportedBootModes())
          Severity: Major
          Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py and 1 other location - About 7 hrs to fix
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 397..408

          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

                      elif Key == DT.TYPE_EVENT_SECTION:
                          EventList = []
                          for Item in SpecialCommentsList[Key]:
                              Event = EventObject()
                              Event.SetEventType(Item.GetEventType())
          Severity: Major
          Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py and 1 other location - About 7 hrs to fix
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 409..420

          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 BinariesDict2:
                      UserExtension = CommonObject.UserExtensionObject()
                      UserExtension.SetBinariesDict(BinariesDict2)
                      UserExtension.SetIdentifier('BinaryFileModifiers')
                      UserExtension.SetUserID('EDK2')
          Severity: Major
          Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py and 1 other location - About 2 hrs to fix
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 293..298

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

          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 DefinesDictNew:
                      UserExtension = CommonObject.UserExtensionObject()
                      UserExtension.SetDefinesDict(DefinesDictNew)
                      UserExtension.SetIdentifier('DefineModifiers')
                      UserExtension.SetUserID('EDK2')
          Severity: Major
          Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py and 1 other location - About 2 hrs to fix
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 814..819

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

          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 DefineObj.GetInfVersion() == None:
                      Logger.Error("InfParser", FORMAT_INVALID,
                                   ST.ERR_INF_PARSER_DEFINE_SECTION_MUST_ITEM_NOT_EXIST % ("INF_VERSION"), File=self.FullPath)
                  else:
                      self.SetVersion(DefineObj.GetInfVersion().GetValue())
          Severity: Major
          Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py and 2 other locations - About 2 hrs to fix
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 212..216
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 222..226

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

                  if DefineObj.GetFileGuid() == None:
                      Logger.Error("InfParser", FORMAT_INVALID,
                                   ST.ERR_INF_PARSER_DEFINE_SECTION_MUST_ITEM_NOT_EXIST % ("FILE_GUID"), File=self.FullPath)
                  else:
                      self.SetGuid(DefineObj.GetFileGuid().GetValue())
          Severity: Major
          Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py and 2 other locations - About 2 hrs to fix
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 212..216
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 217..221

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

                  if DefineObj.GetBaseName() == None:
                      Logger.Error("InfParser", FORMAT_INVALID,
                                   ST.ERR_INF_PARSER_DEFINE_SECTION_MUST_ITEM_NOT_EXIST % ("BASE_NAME"), File=self.FullPath)
                  else:
                      self.SetBaseName(DefineObj.GetBaseName().GetValue())
          Severity: Major
          Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py and 2 other locations - About 2 hrs to fix
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 217..221
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 222..226

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

                  if DefineObj.GetUefiSpecificationVersion() != None:
                      __UefiVersion = DefineObj.GetUefiSpecificationVersion().GetValue()
                      __UefiVersion = ConvertVersionToDecimal(__UefiVersion)
                      self.SetUefiSpecificationVersion(str(__UefiVersion))
          Severity: Major
          Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py and 1 other location - About 1 hr to fix
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 177..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 49.

          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 DefineObj.GetPiSpecificationVersion() != None:
                      __PiVersion = DefineObj.GetPiSpecificationVersion().GetValue()
                      __PiVersion = ConvertVersionToDecimal(__PiVersion)
          
                      self.SetPiSpecificationVersion(str(__PiVersion))
          Severity: Major
          Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py and 1 other location - About 1 hr to fix
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 173..176

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

          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

                  for UnloadImage in UnloadImageList:
                      Image = ExternObject()
                      #
                      # Future enhancement
                      #                
          Severity: Major
          Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py and 3 other locations - About 1 hr to fix
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 337..343
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 359..365
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 370..376

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

          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

                  for ConstructorItem in ConstructorList:
                      Image = ExternObject()
                      #
                      # Future enhancement
                      #                  
          Severity: Major
          Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py and 3 other locations - About 1 hr to fix
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 337..343
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 348..354
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 370..376

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

          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

                  for EntryPoint in EntryPointList:
                      Image = ExternObject()
                      Image.SetEntryPoint(EntryPoint.GetCName())
                      #
                      # Future enhancement
          Severity: Major
          Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py and 3 other locations - About 1 hr to fix
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 348..354
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 359..365
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 370..376

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

          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

                  for DestructorItem in DestructorList:
                      Image = ExternObject()
                      #
                      # Future enhancement
                      #                
          Severity: Major
          Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py and 3 other locations - About 1 hr to fix
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 337..343
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 348..354
          BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py on lines 359..365

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

          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