hackedteam/vector-edk

View on GitHub
BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py

Summary

Maintainability
F
2 wks
Test Coverage

File InfDefineObject.py has 673 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# This file is used to define class objects of [Defines] section for INF file. 
# It will consumed by InfParser
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
Severity: Major
Found in BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py - About 1 day to fix

    InfDefSection has 39 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class InfDefSection(InfDefSectionOptionRomInfo):
        def __init__(self):
            self.BaseName                   = None
            self.FileGuid                   = None
            self.ModuleType                 = None
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py - About 5 hrs to fix

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

          def SetDefines(self, DefineContent, Arch = None):
              #
              # Validate Arch
              #
              HasFoundInfVersionFalg = False
      Severity: Minor
      Found in BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py - About 5 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function SetCustomMakefile has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          def SetCustomMakefile(self, CustomMakefile, Comments):
              if not (CustomMakefile == '' or CustomMakefile == None):
                  ValueList = GetSplitValueList(CustomMakefile)
                  if len(ValueList) == 1:
                      FileName = ValueList[0]
      Severity: Minor
      Found in BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.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 SetConstructor has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def SetConstructor(self, Constructor, Comments):
              #
              # It can be a list
              #
              ValueList = []
      Severity: Minor
      Found in BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.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 SetDestructor has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def SetDestructor(self, Destructor, Comments):
              #
              # It can be a list and only 1 set to TRUE
              #        
              ValueList = []
      Severity: Minor
      Found in BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.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 SetLibraryClass has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def SetLibraryClass(self, LibraryClass, Comments):
              ValueList = GetSplitValueList(LibraryClass)
              Name = ValueList[0]         
              if IsValidWord(Name):
                  InfDefineLibraryItemObj = InfDefineLibraryItem()
      Severity: Minor
      Found in BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.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 SetUefiHiiResourceSection has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def SetUefiHiiResourceSection(self, UefiHiiResourceSection, Comments):
              #
              # Value has been set before.
              #
              if self.UefiHiiResourceSection != None:
      Severity: Minor
      Found in BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.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 SetUnloadImages has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def SetUnloadImages(self, UnloadImages, Comments):
              #
              # It can be a list
              #
              ValueList = []
      Severity: Minor
      Found in BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.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 SetBaseName has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def SetBaseName(self, BaseName, Comments):
              #
              # Value has been set before.
              #
              if self.BaseName != None:    
      Severity: Minor
      Found in BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.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 SetEntryPoint has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def SetEntryPoint(self, EntryPoint, Comments):
              #
              # It can be a list
              #
              ValueList = []
      Severity: Minor
      Found in BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.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 SetSpecification has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def SetSpecification(self, Specification, Comments):
              #
              # Valid the value of Specification
              #
              __ValueList = []
      Severity: Minor
      Found in BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.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 SetUnloadImages(self, UnloadImages, Comments):
              #
              # It can be a list
              #
              ValueList = []
      Severity: Major
      Found in BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py and 1 other location - About 2 days to fix
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 518..553

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

      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 SetEntryPoint(self, EntryPoint, Comments):
              #
              # It can be a list
              #
              ValueList = []
      Severity: Major
      Found in BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py and 1 other location - About 2 days to fix
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 561..593

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

      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 SetPciCompress(self, PciCompress, Comments):
              #
              # Value has been set before.
              #
              if self.PciCompress != None:
      Severity: Major
      Found in BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py and 1 other location - About 1 day to fix
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 493..510

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

      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 SetPcdIsDriver(self, PcdIsDriver, Comments):
              #
              # Value has been set before.
              #
              if self.PcdIsDriver != None:    
      Severity: Major
      Found in BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py and 1 other location - About 1 day to fix
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 157..177

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

      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

          def SetEdkReleaseVersion(self, EdkReleaseVersion, Comments):
              #
              # Value has been set before.
              #
              if self.EdkReleaseVersion != None:    
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 377..399
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 410..432

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

      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

          def SetUefiSpecificationVersion(self, UefiSpecificationVersion, Comments):
              #
              # Value has been set before.
              #
              if self.UefiSpecificationVersion != None:    
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 344..366
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 410..432

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

      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

          def SetPiSpecificationVersion(self, PiSpecificationVersion, Comments):
              #
              # Value has been set before.
              #
              if self.PiSpecificationVersion != None:    
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 344..366
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 377..399

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

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

          def SetFileGuid(self, FileGuid, Comments):
              #
              # Value has been set before.
              #
              if self.FileGuid != None:    
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 60..79
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 84..103
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 108..128
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 133..152
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 698..714

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

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

          def SetPciVendorId(self, PciVendorId, Comments):
              #
              # Value has been set before.
              #
              if self.PciVendorId != None:
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 84..103
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 108..128
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 133..152
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 241..261
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 698..714

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

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

          def SetPciDeviceId(self, PciDeviceId, Comments):
              #
              # Value has been set before.
              #
              if self.PciDeviceId != None:
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 60..79
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 108..128
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 133..152
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 241..261
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 698..714

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

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

          def SetPciRevision(self, PciRevision, Comments):
              #
              # Value has been set before.
              #
              if self.PciRevision != None:
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 60..79
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 84..103
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 108..128
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 241..261
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 698..714

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

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

          def SetPciClassCode(self, PciClassCode, Comments):
              #
              # Value has been set before.
              #
              if self.PciClassCode != None:
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 60..79
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 84..103
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 133..152
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 241..261
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 698..714

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

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

          def SetShadow(self, Shadow, Comments):
              #
              # Value has been set before.
              #
              if self.Shadow != None:
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 60..79
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 84..103
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 108..128
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 133..152
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 241..261

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

      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 Name not in gFUNCTION_MAPPING_FOR_DEFINE_SECTION.keys():
                              ErrorInInf(ST.ERR_INF_PARSER_DEFINE_SECTION_KEYWORD_INVALID%(Name),
                                         LineInfo=LineInfo)
                          #
                          # Found the process function from mapping table.
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 954..959

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

      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 Name not in gFUNCTION_MAPPING_FOR_DEFINE_SECTION.keys():
                              ErrorInInf(ST.ERR_INF_PARSER_DEFINE_SECTION_KEYWORD_INVALID%(Name),
                                         LineInfo=LineInfo)   
                                                       
                          else:
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 972..979

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

      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 ModItem in ModList:
                      if ModItem not in DT.MODULE_LIST:
                          ErrorInInf(ST.ERR_INF_PARSER_DEFINE_MODULETYPE_INVALID%(ModItem),
                                     LineInfo=self.CurrentLine)
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 670..673

      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

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

                  for ModItem in ModList:
                      if ModItem not in DT.MODULE_LIST:
                          ErrorInInf(ST.ERR_INF_PARSER_DEFINE_MODULETYPE_INVALID%(ModItem),
                                     LineInfo=self.CurrentLine)
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 620..623

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

              if IsValidPath(DpxSource, ModulePath):
                  IsValidFileFlag = True           
              else:
                  ErrorInInf(ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVALID%(DpxSource),
                             LineInfo=self.CurrentLine)
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 744..749

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

                  if IsValidPath(FileName, ModulePath):
                      IsValidFileFlag = True           
                  else:
                      ErrorInInf(ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVALID%(FileName),
                                 LineInfo=self.CurrentLine)
      BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py on lines 833..838

      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

      There are no issues that match your filters.

      Category
      Status