hackedteam/vector-edk

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

Summary

Maintainability
F
1 wk
Test Coverage

Function SetValueDatumTypeMaxSizeToken has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
Open

def SetValueDatumTypeMaxSizeToken(PcdItem, CurrentLineOfPcdItem, PcdItemObj, Arch, PackageInfo = None):
    #
    # Package information not been generated currently, we need to parser INF file to get information. 
    #
    if not PackageInfo:
Severity: Minor
Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py - About 1 day to fix

Cognitive Complexity

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

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

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

Further reading

Function ParsePcdComment has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
Open

def ParsePcdComment(CommentList, PcdTypeItem, PcdItemObj):
    CommentInsList = []
    PreUsage = None
    PreHelpText = ''
    BlockFlag = -1
Severity: Minor
Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py - About 1 day to fix

Cognitive Complexity

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

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

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

Further reading

Function SetPcds has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
Open

    def SetPcds(self, PcdContent, KeysList = None, PackageInfo = None):
        
        if GlobalData.gIS_BINARY_INF:
            self.SetAsBuildPcds(PcdContent, KeysList, PackageInfo)
            return True
Severity: Minor
Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py - About 7 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

File InfPcdObject.py has 452 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

    InfPcdItem has 29 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class InfPcdItem():
        def __init__(self):
            self.CName = ''
            self.Token = ''
            self.TokenSpaceGuidCName = ''
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py - About 3 hrs to fix

      Function ValidatePcdValueOnDatumType has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
      Open

      def ValidatePcdValueOnDatumType(Value, Type):
          
          Value = Value.strip()
          #
          # Boolean type only allow 0x00 or 0x01 as value per INF spec
      Severity: Minor
      Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py - About 3 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function ValidateArch has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      def ValidateArch(ArchItem, PcdTypeItem1, LineNo, SupArchDict, SupArchList):
          #
          # Validate Arch
          #            
          if (ArchItem == '' or ArchItem == None):
      Severity: Minor
      Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py - About 55 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

      Avoid deeply nested control flow statements.
      Open

                          if PcdInDec.TokenCName == PcdItemObj.CName and \
                             PcdInDec.TokenSpaceGuidCName == PcdItemObj.TokenSpaceGuidCName:
                              PcdItemObj.SetToken(PcdInDec.TokenValue)
                              PcdItemObj.SetDatumType(PcdInDec.DatumType)
                              PcdItemObj.SetSupportArchList([Arch])
      Severity: Major
      Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if GuidInDec.GuidCName == PcdItemObj.TokenSpaceGuidCName:
                                PcdItemObj.SetTokenSpaceGuidValue(GuidInDec.GuidString)
        
            #
            # Validate Value.
        Severity: Major
        Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if PcdInDec.TokenCName == PcdItemObj.CName and \
                                 PcdInDec.TokenSpaceGuidCName == PcdItemObj.TokenSpaceGuidCName:
                                  PcdItemObj.SetToken(PcdInDec.TokenValue)
                                  PcdItemObj.SetDatumType(PcdInDec.DatumType)
                                  PcdItemObj.SetSupportArchList([Arch]) 
          Severity: Major
          Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py - About 45 mins to fix

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

            def SetValueDatumTypeMaxSizeToken(PcdItem, CurrentLineOfPcdItem, PcdItemObj, Arch, PackageInfo = None):
            Severity: Minor
            Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py - About 35 mins to fix

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

              def ValidateArch(ArchItem, PcdTypeItem1, LineNo, SupArchDict, SupArchList):
              Severity: Minor
              Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py - About 35 mins to fix

                Avoid too many return statements within this function.
                Open

                            return False
                Severity: Major
                Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return True
                  Severity: Major
                  Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return False  
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return False
                      Severity: Major
                      Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            return True    
                        Severity: Major
                        Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                      return False
                          Severity: Major
                          Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py - About 30 mins to fix

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

                                def SetAsBuildPcds(self, PcdContent, KeysList = None, PackageInfo = None):
                                    for PcdItem in PcdContent:
                                        PcdItemObj = InfPcdItem()
                                        CommentList = PcdItem[1]
                                        CurrentLineOfPcdItem = PcdItem[2]
                            Severity: Minor
                            Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.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 SetPcdName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def SetPcdName(PcdItem, CurrentLineOfPcdItem, PcdItemObj):
                                #
                                # Only PCD Name specified 
                                # <PcdName> ::= <TokenSpaceGuidCName> "." <TokenCName>
                                #
                            Severity: Minor
                            Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.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 4 locations. Consider refactoring.
                            Open

                                            if len(PcdItem) == 3:
                                                #
                                                # Contain PcdName, value, and FeatureFlag express
                                                #
                                                #
                            Severity: Major
                            Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py and 3 other locations - About 1 day to fix
                            BaseTools/Source/Python/UPT/Object/Parser/InfGuidObject.py on lines 271..295
                            BaseTools/Source/Python/UPT/Object/Parser/InfPpiObject.py on lines 253..278
                            BaseTools/Source/Python/UPT/Object/Parser/InfSoucesObject.py on lines 44..66

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

                            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 (Key[0] == 'PCDSPATCHABLEINMODULE' and PcdItemObj.GetItemType() == 'PatchPcd') and \
                                       (Key[1] == 'COMMON' or Key[1] == Arch):
                                            for PcdInDec in DecPcdsDict[Key]:
                                                if PcdInDec.TokenCName == PcdItemObj.CName and \
                                                   PcdInDec.TokenSpaceGuidCName == PcdItemObj.TokenSpaceGuidCName:
                            Severity: Major
                            Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py and 1 other location - About 1 day to fix
                            BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py on lines 494..501

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

                            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 (Key[0] == 'PCDSDYNAMICEX' and PcdItemObj.GetItemType() == 'PcdEx') and \
                                            (Key[1] == 'COMMON' or Key[1] == Arch):
                                            for PcdInDec in DecPcdsDict[Key]:
                                                if PcdInDec.TokenCName == PcdItemObj.CName and \
                                                   PcdInDec.TokenSpaceGuidCName == PcdItemObj.TokenSpaceGuidCName:
                            Severity: Major
                            Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py and 1 other location - About 1 day to fix
                            BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py on lines 503..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 139.

                            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 self.Pcds.has_key((PcdTypeItem, PcdItemObj)):           
                                                PcdsList = self.Pcds[PcdTypeItem, PcdItemObj]
                                                PcdsList.append(PcdItemObj)
                                                self.Pcds[PcdTypeItem, PcdItemObj] = PcdsList
                                            else:
                            Severity: Major
                            Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py and 1 other location - About 5 hrs to fix
                            BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py on lines 445..452

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

                            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 self.Pcds.has_key((PcdTypeItem, PcdItemObj)):           
                                            PcdsList = self.Pcds[PcdTypeItem, PcdItemObj]
                                            PcdsList.append(PcdItemObj)
                                            self.Pcds[PcdTypeItem, PcdItemObj] = PcdsList
                                        else:
                            Severity: Major
                            Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py and 1 other location - About 5 hrs to fix
                            BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py on lines 408..415

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 87.

                            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

                            class InfPcdItemCommentContent():
                                def __init__(self):
                                    #
                                    # ## SOMETIMES_CONSUMES ## HelpString 
                                    #
                            Severity: Major
                            Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py and 2 other locations - About 3 hrs to fix
                            BaseTools/Source/Python/UPT/Object/Parser/InfCommonObject.py on lines 28..43
                            BaseTools/Source/Python/UPT/Object/Parser/InfDepexObject.py on lines 28..41

                            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

                                    if not IsHexDigitUINT32(PcdItem[2]):
                                        Logger.Error("InfParser", 
                                                     ToolError.FORMAT_INVALID, 
                                                     ST.ERR_ASBUILD_PCD_OFFSET_FORMAT_INVALID%("\"" + PcdItem[2] + "\""),
                                                     File=CurrentLineOfPcdItem[2], 
                            Severity: Major
                            Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py and 1 other location - About 3 hrs to fix
                            BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py on lines 548..554

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

                            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 PcdItemObj.GetToken() == '' or PcdItemObj.GetDatumType() == '':
                                    Logger.Error("InfParser", 
                                                 ToolError.FORMAT_INVALID, 
                                                 ST.ERR_ASBUILD_PCD_DECLARITION_MISS%("\"" + PcdItem[0] + "\""),
                                                 File=CurrentLineOfPcdItem[2], 
                            Severity: Major
                            Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py and 1 other location - About 3 hrs to fix
                            BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py on lines 539..545

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

                            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 not IsValidCVariableName(PcdId[1]):
                                        Logger.Error("InfParser", 
                                                     ToolError.FORMAT_INVALID, 
                                                     ST.ERR_INF_PARSER_PCD_CVAR_PCDCNAME,
                                                     File=CurrentLineOfPcdItem[2], 
                            Severity: Major
                            Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py and 1 other location - About 2 hrs to fix
                            BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py on lines 623..629

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 61.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                    if not IsValidCVariableName(PcdId[0]):
                                        Logger.Error("InfParser", 
                                                     ToolError.FORMAT_INVALID, 
                                                     ST.ERR_INF_PARSER_PCD_CVAR_GUID,
                                                     File=CurrentLineOfPcdItem[2], 
                            Severity: Major
                            Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py and 1 other location - About 2 hrs to fix
                            BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py on lines 630..636

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 61.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                    for ArchItemNew in ArchList:
                                        if not IsValidArch(ArchItemNew):
                                            Logger.Error("InfParser", 
                                                         ToolError.FORMAT_INVALID,
                                                         ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(ArchItemNew), 
                            Severity: Major
                            Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py and 2 other locations - About 1 hr to fix
                            BaseTools/Source/Python/UPT/Library/Misc.py on lines 917..921
                            BaseTools/Source/Python/UPT/Parser/InfAsBuiltProcess.py on lines 196..200

                            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

                            There are no issues that match your filters.

                            Category
                            Status