hackedteam/vector-edk

View on GitHub
BaseTools/Source/Python/UPT/Library/ParserValidate.py

Summary

Maintainability
F
5 days
Test Coverage

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

def IsValidPcdValue(PcdValue):
    for Char in PcdValue:
        if Char == '\n' or Char == '\t' or Char == '\f':
            return False
        
Severity: Minor
Found in BaseTools/Source/Python/UPT/Library/ParserValidate.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

File ParserValidate.py has 347 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file ParserValidate.py
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available 
Severity: Minor
Found in BaseTools/Source/Python/UPT/Library/ParserValidate.py - About 4 hrs to fix

    Function IsValidCFormatGuid has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

    def IsValidCFormatGuid(Guid):
        #
        # Valid: { 0xf0b11735, 0x87a0, 0x4193, {0xb2, 0x66, 0x53, 0x8c, 0x38, 
        #        0xaf, 0x48, 0xce }}
        # Invalid: { 0xf0b11735, 0x87a0, 0x4193, {0xb2, 0x66, 0x53, 0x8c, 0x38, 
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/ParserValidate.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 IsValidPath has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    def IsValidPath(Path, Root):
        Path = Path.strip()
        OrigPath = Path.replace('\\', '/')
        
        Path = os.path.normpath(Path).replace('\\', '/')
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/ParserValidate.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

    Consider simplifying this complex logical expression.
    Open

        if BoolString == 'TRUE' or \
           BoolString == 'True' or \
           BoolString == 'true' or \
           BoolString == '0x1' or \
           BoolString == '0x01':
    Severity: Critical
    Found in BaseTools/Source/Python/UPT/Library/ParserValidate.py - About 1 hr to fix

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

      def IsValidInstallPath(Path):
          if platform.platform().find("Windows") >= 0:
              if os.path.isabs(Path):
                  return False
          else:
      Severity: Minor
      Found in BaseTools/Source/Python/UPT/Library/ParserValidate.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 IsValidUserId has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      def IsValidUserId(UserId):
          UserId = UserId.strip()
          Quoted = False
          if UserId.startswith('"') and UserId.endswith('"'):
              Quoted = True
      Severity: Minor
      Found in BaseTools/Source/Python/UPT/Library/ParserValidate.py - About 55 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

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

      def IsValidWord(Word):
          if not Word:
              return False
          #
          # The first char should be alpha, _ or Digit.
      Severity: Minor
      Found in BaseTools/Source/Python/UPT/Library/ParserValidate.py - About 55 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

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

      def IsValidNormalizedString(String):
          if String == '':
              return True
          
          for Char in String:
      Severity: Minor
      Found in BaseTools/Source/Python/UPT/Library/ParserValidate.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

      Consider simplifying this complex logical expression.
      Open

          if (TempChar >= 'a' and TempChar <= 'f') or \
          (TempChar >= 'A' and TempChar <= 'F') \
                  or (TempChar >= '0' and TempChar <= '9'):
              return True
          else:
      Severity: Major
      Found in BaseTools/Source/Python/UPT/Library/ParserValidate.py - About 40 mins to fix

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

        def IsValidBuildOptionName(BuildOptionName):
            if not BuildOptionName:
                return False
            
            ToolOptionList = GetSplitValueList(BuildOptionName, '_', 4)
        Severity: Minor
        Found in BaseTools/Source/Python/UPT/Library/ParserValidate.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 __HexDigit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        def __HexDigit(TempChar):
            if (TempChar >= 'a' and TempChar <= 'f') or \
            (TempChar >= 'A' and TempChar <= 'F') \
                    or (TempChar >= '0' and TempChar <= '9'):
                return True
        Severity: Minor
        Found in BaseTools/Source/Python/UPT/Library/ParserValidate.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

        Avoid too many return statements within this function.
        Open

                return False
        Severity: Major
        Found in BaseTools/Source/Python/UPT/Library/ParserValidate.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/Library/ParserValidate.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/Library/ParserValidate.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/Library/ParserValidate.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/Library/ParserValidate.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/Library/ParserValidate.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/Library/ParserValidate.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/Library/ParserValidate.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/Library/ParserValidate.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/Library/ParserValidate.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/Library/ParserValidate.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                          return IsTrue
                              Severity: Major
                              Found in BaseTools/Source/Python/UPT/Library/ParserValidate.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/Library/ParserValidate.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/Library/ParserValidate.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/Library/ParserValidate.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/Library/ParserValidate.py - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                            return SepValue == '}}' and Value == ''
                                        Severity: Major
                                        Found in BaseTools/Source/Python/UPT/Library/ParserValidate.py - About 30 mins to fix

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

                                          def IsValidIdString(String):
                                              if IsValidSimpleWord(String.strip()):
                                                  return True
                                              
                                              if String.strip().startswith('"') and \
                                          Severity: Minor
                                          Found in BaseTools/Source/Python/UPT/Library/ParserValidate.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 5 locations. Consider refactoring.
                                          Open

                                          def IsValidHexVersion(Word):
                                              ReIsValidHexVersion = re.compile(r"[0][xX][0-9A-Fa-f]{8}$", re.DOTALL)
                                              if ReIsValidHexVersion.match(Word) == None:
                                                  return False
                                              
                                          Severity: Major
                                          Found in BaseTools/Source/Python/UPT/Library/ParserValidate.py and 4 other locations - About 1 hr to fix
                                          BaseTools/Source/Python/UPT/Library/ParserValidate.py on lines 127..131
                                          BaseTools/Source/Python/UPT/Library/ParserValidate.py on lines 470..475
                                          BaseTools/Source/Python/UPT/Library/ParserValidate.py on lines 654..659
                                          BaseTools/Source/Python/UPT/Library/ParserValidate.py on lines 669..674

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

                                          def IsValidIdentifier(Ident):
                                              ReIdent = re.compile(r"^[A-Za-z_][0-9A-Za-z_]*$", re.DOTALL)
                                              if ReIdent.match(Ident) == None:
                                                  return False
                                              
                                          Severity: Major
                                          Found in BaseTools/Source/Python/UPT/Library/ParserValidate.py and 4 other locations - About 1 hr to fix
                                          BaseTools/Source/Python/UPT/Library/ParserValidate.py on lines 127..131
                                          BaseTools/Source/Python/UPT/Library/ParserValidate.py on lines 456..461
                                          BaseTools/Source/Python/UPT/Library/ParserValidate.py on lines 470..475
                                          BaseTools/Source/Python/UPT/Library/ParserValidate.py on lines 654..659

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

                                          def IsValidCVariableName(CName):
                                              ReIsValidCName = re.compile(r"^[A-Za-z_][0-9A-Za-z_]*$", re.DOTALL)
                                              if ReIsValidCName.match(CName) == None:
                                                  return False
                                              
                                          Severity: Major
                                          Found in BaseTools/Source/Python/UPT/Library/ParserValidate.py and 4 other locations - About 1 hr to fix
                                          BaseTools/Source/Python/UPT/Library/ParserValidate.py on lines 127..131
                                          BaseTools/Source/Python/UPT/Library/ParserValidate.py on lines 456..461
                                          BaseTools/Source/Python/UPT/Library/ParserValidate.py on lines 470..475
                                          BaseTools/Source/Python/UPT/Library/ParserValidate.py on lines 669..674

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

                                          def IsValidBuildNumber(Word):
                                              ReIsValieBuildNumber = re.compile(r"[0-9]{1,4}$", re.DOTALL)
                                              if ReIsValieBuildNumber.match(Word) == None:
                                                  return False
                                              
                                          Severity: Major
                                          Found in BaseTools/Source/Python/UPT/Library/ParserValidate.py and 4 other locations - About 1 hr to fix
                                          BaseTools/Source/Python/UPT/Library/ParserValidate.py on lines 127..131
                                          BaseTools/Source/Python/UPT/Library/ParserValidate.py on lines 456..461
                                          BaseTools/Source/Python/UPT/Library/ParserValidate.py on lines 654..659
                                          BaseTools/Source/Python/UPT/Library/ParserValidate.py on lines 669..674

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

                                          def IsValidToolFamily(ToolFamily):
                                              ReIsValieFamily = re.compile(r"^[A-Z]+[A-Za-z0-9]{0,}$", re.DOTALL)
                                              if ReIsValieFamily.match(ToolFamily) == None:
                                                  return False
                                              return True
                                          Severity: Major
                                          Found in BaseTools/Source/Python/UPT/Library/ParserValidate.py and 4 other locations - About 1 hr to fix
                                          BaseTools/Source/Python/UPT/Library/ParserValidate.py on lines 456..461
                                          BaseTools/Source/Python/UPT/Library/ParserValidate.py on lines 470..475
                                          BaseTools/Source/Python/UPT/Library/ParserValidate.py on lines 654..659
                                          BaseTools/Source/Python/UPT/Library/ParserValidate.py on lines 669..674

                                          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

                                              elif BoolString == 'FALSE' or \
                                                   BoolString == 'False' or \
                                                   BoolString == 'false' or \
                                                   BoolString == '0x0' or \
                                                   BoolString == '0x00':
                                          Severity: Major
                                          Found in BaseTools/Source/Python/UPT/Library/ParserValidate.py and 1 other location - About 1 hr to fix
                                          BaseTools/Source/Python/UPT/Library/ParserValidate.py on lines 71..75

                                          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 BoolString == 'TRUE' or \
                                                 BoolString == 'True' or \
                                                 BoolString == 'true' or \
                                                 BoolString == '0x1' or \
                                                 BoolString == '0x01':
                                          Severity: Major
                                          Found in BaseTools/Source/Python/UPT/Library/ParserValidate.py and 1 other location - About 1 hr to fix
                                          BaseTools/Source/Python/UPT/Library/ParserValidate.py on lines 80..84

                                          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

                                                  elif PcdValue.strip().startswith('\"'):
                                                      StringValue = PcdValue.strip().lstrip('\"').rstrip('\"')
                                                      if IsValidBareCString(StringValue):
                                                          IsTrue = True
                                          Severity: Minor
                                          Found in BaseTools/Source/Python/UPT/Library/ParserValidate.py and 1 other location - About 45 mins to fix
                                          BaseTools/Source/Python/UPT/Library/ParserValidate.py on lines 601..604

                                          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 PcdValue.strip().startswith('L\"'):
                                                      StringValue = PcdValue.strip().lstrip('L\"').rstrip('\"')
                                                      if IsValidBareCString(StringValue):
                                                          IsTrue = True
                                          Severity: Minor
                                          Found in BaseTools/Source/Python/UPT/Library/ParserValidate.py and 1 other location - About 45 mins to fix
                                          BaseTools/Source/Python/UPT/Library/ParserValidate.py on lines 605..608

                                          Duplicated Code

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

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

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

                                          Tuning

                                          This issue has a mass of 35.

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

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

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

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

                                          Refactorings

                                          Further Reading

                                          There are no issues that match your filters.

                                          Category
                                          Status