hackedteam/vector-edk

View on GitHub
BaseTools/Source/Python/AutoGen/GenMake.py

Summary

Maintainability
F
1 wk
Test Coverage

File GenMake.py has 845 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# Create makefile for MS nmake and GNU make
#
# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
Severity: Major
Found in BaseTools/Source/Python/AutoGen/GenMake.py - About 2 days to fix

    Function GetDependencyList has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
    Open

        def GetDependencyList(self, File, ForceList, SearchPathList):
            EdkLogger.debug(EdkLogger.DEBUG_1, "Try to get dependency files for %s" % File)
            FileStack = [File] + ForceList
            DependencySet = set()
    
    Severity: Minor
    Found in BaseTools/Source/Python/AutoGen/GenMake.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 ProcessBuildTargetList has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
    Open

        def ProcessBuildTargetList(self):
            #
            # Search dependency file list for each source file
            #
            ForceIncludedFile = []
    Severity: Minor
    Found in BaseTools/Source/Python/AutoGen/GenMake.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 _CreateTemplateDict has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

        def _CreateTemplateDict(self):
            if self._FileType not in self._SEP_:
                EdkLogger.error("build", PARAMETER_INVALID, "Invalid Makefile type [%s]" % self._FileType,
                                ExtraData="[%s]" % str(self._AutoGenObject))
            Separator = self._SEP_[self._FileType]
    Severity: Minor
    Found in BaseTools/Source/Python/AutoGen/GenMake.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 _CreateTemplateDict has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def _CreateTemplateDict(self):
            Separator = self._SEP_[self._FileType]
    
            # any platform autogen object is ok because we just need common information
            PlatformInfo = self._AutoGenObject
    Severity: Minor
    Found in BaseTools/Source/Python/AutoGen/GenMake.py - About 2 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function _CreateTemplateDict has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def _CreateTemplateDict(self):
            Separator = self._SEP_[self._FileType]
            if self._FileType not in self._AutoGenObject.CustomMakefile:
                EdkLogger.error('build', OPTION_NOT_SUPPORTED, "No custom makefile for %s" % self._FileType,
                                ExtraData="[%s]" % str(self._AutoGenObject))
    Severity: Minor
    Found in BaseTools/Source/Python/AutoGen/GenMake.py - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function __init__ has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def __init__(self, ModuleAutoGen):
            BuildFile.__init__(self, ModuleAutoGen)
            self.PlatformInfo = self._AutoGenObject.PlatformInfo
    
            self.ResultFileList = []
    Severity: Minor
    Found in BaseTools/Source/Python/AutoGen/GenMake.py - About 1 hr to fix

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

          def PlaceMacro(self, Path, MacroDefinitions={}):
              if Path.startswith("$("):
                  return Path
              else:
                  PathLength = len(Path)
      Severity: Minor
      Found in BaseTools/Source/Python/AutoGen/GenMake.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 HeaderType in gIncludeMacroConversion:
                                  Inc = gIncludeMacroConversion[HeaderType] % {"HeaderKey" : HeaderKey}
                              else:
                                  # not known macro used in #include, always build the file by
                                  # returning a empty dependency
      Severity: Major
      Found in BaseTools/Source/Python/AutoGen/GenMake.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if not gIsFileMap[FilePath]:
                                    continue
                            # If isfile is called too many times, the performance is slow down.
                            elif not os.path.isfile(FilePath):
        Severity: Major
        Found in BaseTools/Source/Python/AutoGen/GenMake.py - About 45 mins to fix

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

                  for D in self.ModuleBuildDirectoryList:
                      D = self.PlaceMacro(D, {"BUILD_DIR":PlatformInfo.BuildDir})
                      Makefile = os.path.join(D, MakefileName)
                      Command = self._MAKE_TEMPLATE_[self._FileType] % {"file":Makefile}
                      ModuleMakefileList.append(Makefile)
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenMake.py and 1 other location - About 4 hrs to fix
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 1124..1129

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

          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 D in self.LibraryBuildDirectoryList:
                      D = self.PlaceMacro(D, {"BUILD_DIR":PlatformInfo.BuildDir})
                      Makefile = os.path.join(D, MakefileName)
                      Command = self._MAKE_TEMPLATE_[self._FileType] % {"file":Makefile}
                      LibraryMakefileList.append(Makefile)
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenMake.py and 1 other location - About 4 hrs to fix
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 1133..1138

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

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

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

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

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

          Refactorings

          Further Reading

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

                  if "MAKE" not in PlatformInfo.ToolDefinition or "PATH" not in PlatformInfo.ToolDefinition["MAKE"]:
                      EdkLogger.error("build", OPTION_MISSING, "No MAKE command defined. Please check your tools_def.txt!",
                                      ExtraData="[%s]" % str(self._AutoGenObject))
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenMake.py and 1 other location - About 2 hrs to fix
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 1113..1115

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

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

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

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

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

          Refactorings

          Further Reading

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

                  if "MAKE" not in PlatformInfo.ToolDefinition or "PATH" not in PlatformInfo.ToolDefinition["MAKE"]:
                      EdkLogger.error("build", OPTION_MISSING, "No MAKE command defined. Please check your tools_def.txt!",
                                      ExtraData="[%s]" % str(self._AutoGenObject))
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenMake.py and 1 other location - About 2 hrs to fix
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 1309..1311

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

          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

              def GetModuleBuildDirectoryList(self):
                  DirList = []
                  for ModuleAutoGen in self._AutoGenObject.ModuleAutoGenList:
                      DirList.append(os.path.join(self._AutoGenObject.BuildDir, ModuleAutoGen.BuildDir))
                  return DirList
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenMake.py and 3 other locations - About 1 hr to fix
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 1174..1178
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 1184..1188
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 1400..1404

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

          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

              def GetModuleBuildDirectoryList(self):
                  DirList = []
                  for ModuleAutoGen in self._AutoGenObject.ModuleAutoGenList:
                      DirList.append(os.path.join(self._AutoGenObject.BuildDir, ModuleAutoGen.BuildDir))
                  return DirList
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenMake.py and 3 other locations - About 1 hr to fix
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 1184..1188
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 1390..1394
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 1400..1404

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

          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

              def GetLibraryBuildDirectoryList(self):
                  DirList = []
                  for LibraryAutoGen in self._AutoGenObject.LibraryAutoGenList:
                      DirList.append(os.path.join(self._AutoGenObject.BuildDir, LibraryAutoGen.BuildDir))
                  return DirList
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenMake.py and 3 other locations - About 1 hr to fix
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 1174..1178
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 1390..1394
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 1400..1404

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

          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

              def GetLibraryBuildDirectoryList(self):
                  DirList = []
                  for LibraryAutoGen in self._AutoGenObject.LibraryAutoGenList:
                      DirList.append(os.path.join(self._AutoGenObject.BuildDir, LibraryAutoGen.BuildDir))
                  return DirList
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenMake.py and 3 other locations - About 1 hr to fix
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 1174..1178
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 1184..1188
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 1390..1394

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

          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

              def GetCreateDirectoryCommand(self, DirList):
                  return [self._MD_TEMPLATE_[self._FileType] % {'dir':Dir} for Dir in DirList]
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenMake.py and 1 other location - About 1 hr to fix
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 202..203

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

          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

              def GetRemoveDirectoryCommand(self, DirList):
                  return [self._RD_TEMPLATE_[self._FileType] % {'dir':Dir} for Dir in DirList]
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenMake.py and 1 other location - About 1 hr to fix
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 193..194

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

          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 T.GenListFile and T.ListFileMacro not in self.ListFileMacros:
                              self.ListFileMacros[T.ListFileMacro] = []
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenMake.py and 2 other locations - About 50 mins to fix
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 655..656
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 659..660

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

                          if T.GenFileListMacro and T.FileListMacro not in self.FileListMacros:
                              self.FileListMacros[T.FileListMacro] = []
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenMake.py and 2 other locations - About 50 mins to fix
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 657..658
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 659..660

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

                          if T.GenIncListFile and T.IncListFileMacro not in self.ListFileMacros:
                              self.ListFileMacros[T.IncListFileMacro] = []
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenMake.py and 2 other locations - About 50 mins to fix
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 655..656
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 657..658

          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 self._FileType not in self._AutoGenObject.CustomMakefile:
                      EdkLogger.error('build', OPTION_NOT_SUPPORTED, "No custom makefile for %s" % self._FileType,
                                      ExtraData="[%s]" % str(self._AutoGenObject))
          Severity: Minor
          Found in BaseTools/Source/Python/AutoGen/GenMake.py and 1 other location - About 45 mins to fix
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 443..445

          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 self._FileType not in self._SEP_:
                      EdkLogger.error("build", PARAMETER_INVALID, "Invalid Makefile type [%s]" % self._FileType,
                                      ExtraData="[%s]" % str(self._AutoGenObject))
          Severity: Minor
          Found in BaseTools/Source/Python/AutoGen/GenMake.py and 1 other location - About 45 mins to fix
          BaseTools/Source/Python/AutoGen/GenMake.py on lines 925..927

          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

          There are no issues that match your filters.

          Category
          Status