hackedteam/vector-edk

View on GitHub
BaseTools/Source/Python/UPT/Core/IpiDb.py

Summary

Maintainability
F
1 wk
Test Coverage

File IpiDb.py has 546 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# This file is for installed package information database operations
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
#
Severity: Major
Found in BaseTools/Source/Python/UPT/Core/IpiDb.py - About 1 day to fix

    IpiDatabase has 25 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class IpiDatabase(object):
        def __init__(self, DbPath):
            Dir = os.path.dirname(DbPath)
            if not os.path.isdir(Dir):
                os.mkdir(Dir)
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Core/IpiDb.py - About 2 hrs to fix

      Function AddDPObject has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def AddDPObject(self, DpObj, NewDpPkgFileName, DpPkgFileName, RePackage):
              try:
                  for PkgKey in DpObj.PackageSurfaceArea.keys():
                      PkgGuid = PkgKey[0]
                      PkgVersion = PkgKey[1]
      Severity: Minor
      Found in BaseTools/Source/Python/UPT/Core/IpiDb.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 _AddStandaloneModule has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

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

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

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

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

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

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

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

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

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

                Function _AddDp has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def _AddDp(self, Guid, Version, NewDpFileName, DistributionFileName, \
                Severity: Minor
                Found in BaseTools/Source/Python/UPT/Core/IpiDb.py - About 35 mins to fix

                  Function _AddPackage has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

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

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

                        def GetRePkgDict(self):
                            SqlCommand = """select * from %s """ % (self.DpTable)
                            self.Cur.execute(SqlCommand)
                            
                            DpInfoList = []
                    Severity: Minor
                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.py - About 35 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

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

                        def GetDpInstallDirList(self, Guid, Version):
                            SqlCommand = """select InstallPath from PkgInfo where DpGuid = '%s' and DpVersion = '%s'""" % (Guid, Version)
                            self.Cur.execute(SqlCommand)
                            DirList = []
                            for Result in self.Cur:
                    Severity: Minor
                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.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

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

                        def GetDpDependentModuleList(self, DpGuid, DpVersion):
                            
                            ModList = []
                            PkgList = self.GetPackageListFromDp(DpGuid, DpVersion)
                            if len(PkgList) > 0:
                    Severity: Minor
                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.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

                        def _AddStandaloneModule(self, Guid, Version, Name, DpGuid=None, \
                                                 DpVersion=None, Path=''):
                            
                            if Version == None or len(Version.strip()) == 0:
                                Version = 'N/A'
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.py and 1 other location - About 1 day to fix
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 312..332

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

                    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 _AddModuleInPackage(self, Guid, Version, Name, PkgGuid=None, \
                                                PkgVersion=None, Path=''):
                            
                            if Version == None or len(Version.strip()) == 0:
                                Version = 'N/A'
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.py and 1 other location - About 1 day to fix
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 343..363

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

                    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 GetSModInsPathListFromDp(self, DpGuid, DpVersion):
                    
                            PathList = []
                            SqlCommand = """select InstallPath from %s where DpGuid ='%s' 
                            and DpVersion = '%s'
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.py and 1 other location - About 3 hrs to fix
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 814..829

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

                    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 GetDpModuleList(self, DpGuid, DpVersion):      
                            ModList = []
                            #
                            # get Dp module list from the DpFileList table
                            #
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.py and 1 other location - About 3 hrs to fix
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 718..730

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

                    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

                            for PkgInfo in self.Cur:
                                PkgGuid = PkgInfo[0]
                                PkgVersion = PkgInfo[1]
                                InstallTime = PkgInfo[2]
                                InstallPath = PkgInfo[5]
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.py and 2 other locations - About 3 hrs to fix
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 671..677
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 703..709

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

                    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

                            for ModInfo in self.Cur:
                                ModGuid = ModInfo[0]
                                ModVersion = ModInfo[1]
                                InstallTime = ModInfo[2]
                                InstallPath = ModInfo[5]
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.py and 2 other locations - About 3 hrs to fix
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 637..643
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 703..709

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

                    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

                            for ModInfo in self.Cur:
                                ModGuid = ModInfo[0]
                                ModVersion = ModInfo[1]
                                InstallTime = ModInfo[2]
                                InstallPath = ModInfo[5]
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.py and 2 other locations - About 3 hrs to fix
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 637..643
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 671..677

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

                    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

                                for ModInfo in self.Cur:
                                    ModGuid = ModInfo[0]
                                    ModVersion = ModInfo[1]
                                    InstallPath = ModInfo[2]
                                    ModList.append((ModGuid, ModVersion, InstallPath))
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.py and 2 other locations - About 2 hrs to fix
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 744..748
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 800..804

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

                    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

                                for ModInfo in self.Cur:
                                    ModGuid = ModInfo[0]
                                    ModVersion = ModInfo[1]
                                    InstallPath = ModInfo[2]
                                    ModList.append((ModGuid, ModVersion, InstallPath))
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.py and 2 other locations - About 2 hrs to fix
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 744..748
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 780..784

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

                    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

                            for PkgInfo in self.Cur:
                                PkgGuid = PkgInfo[0]
                                PkgVersion = PkgInfo[1]
                                InstallPath = PkgInfo[5]
                                PkgList.append((PkgGuid, PkgVersion, InstallPath))
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.py and 2 other locations - About 2 hrs to fix
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 780..784
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 800..804

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

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

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

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

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

                    Refactorings

                    Further Reading

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

                                        for Dep in ModObj.GetPackageDependencyList():
                                            DepexGuid = Dep.GetGuid()
                                            DepexVersion = Dep.GetVersion()
                                            self._AddModuleDepex(ModGuid, ModVersion, ModName, ModInstallPath, \
                                                                 DepexGuid, DepexVersion)
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.py and 1 other location - About 1 hr to fix
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 205..209

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 42.

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

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

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

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

                    Refactorings

                    Further Reading

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

                                    for Dep in ModObj.GetPackageDependencyList():
                                        DepexGuid = Dep.GetGuid()
                                        DepexVersion = Dep.GetVersion()
                                        self._AddModuleDepex(ModGuid, ModVersion, ModName, ModInstallPath, \
                                                             DepexGuid, DepexVersion)
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.py and 1 other location - About 1 hr to fix
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 185..189

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 42.

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

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

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

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

                    Refactorings

                    Further Reading

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

                            for Result in self.Cur:
                                Path = Result[0]
                                Md5Sum = Result[3]
                                PathList.append((Path, Md5Sum))
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.py and 1 other location - About 1 hr to fix
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 850..853

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 42.

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

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

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

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

                    Refactorings

                    Further Reading

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

                            for DepInfo in self.Cur:
                                DepexGuid = DepInfo[3]
                                DepexVersion = DepInfo[4]
                                DepexList.append((DepexGuid, DepexVersion))
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.py and 1 other location - About 1 hr to fix
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 554..557

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 42.

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

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

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

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

                    Refactorings

                    Further Reading

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

                            for Result in self.Cur:
                                if Result[0] not in DirList:
                                    DirList.append(Result[0])
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.py and 2 other locations - About 1 hr to fix
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 526..528
                    BaseTools/Source/Python/UPT/Parser/InfPackageSectionParser.py on lines 130..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 39.

                    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

                            for Result in self.Cur:
                                if Result[0] not in DirList:
                                    DirList.append(Result[0])
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.py and 2 other locations - About 1 hr to fix
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 533..535
                    BaseTools/Source/Python/UPT/Parser/InfPackageSectionParser.py on lines 130..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 39.

                    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

                                    for (Path, Md5Sum) in ModObj.FileList:
                                        self._AddDpFilePathList(DpObj.Header.GetGuid(), \
                                                                DpObj.Header.GetVersion(), \
                                                                Path, Md5Sum)
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.py and 2 other locations - About 45 mins to fix
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 190..193
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 218..220

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

                                    for (FilePath, Md5Sum) in PkgObj.FileList:
                                        self._AddDpFilePathList(DpObj.Header.GetGuid(), \
                                                                DpObj.Header.GetVersion(), FilePath, \
                                                                Md5Sum)
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.py and 2 other locations - About 45 mins to fix
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 210..213
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 218..220

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

                                for (Path, Md5Sum) in DpObj.FileList:
                                    self._AddDpFilePathList(DpObj.Header.GetGuid(), \
                                                            DpObj.Header.GetVersion(), Path, Md5Sum)
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.py and 2 other locations - About 45 mins to fix
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 190..193
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 210..213

                    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 PkgVersion == '' or PkgGuid == '':
                                SqlCommand = """select * from %s where ModuleGuid ='%s' and 
                                ModuleVersion = '%s' and InstallPath = '%s' 
                                and ModuleName = '%s'""" % (self.ModInPkgTable, ModuleGuid, \
                                                           ModuleVersion, InstallPath, ModuleName)
                    Severity: Minor
                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.py and 1 other location - About 35 mins to fix
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 688..700

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

                            if DpGuid == '':
                                SqlCommand = """select * from %s where ModuleGuid ='%s' and 
                                ModuleVersion = '%s' and InstallPath = '%s' 
                                and ModuleName = '%s'""" % (self.StandaloneModTable, ModuleGuid, \
                                                           ModuleVersion, InstallPath, ModuleName)
                    Severity: Minor
                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.py and 1 other location - About 35 mins to fix
                    BaseTools/Source/Python/UPT/Core/IpiDb.py on lines 655..668

                    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

                    There are no issues that match your filters.

                    Category
                    Status