hackedteam/vector-edk

View on GitHub
BaseTools/Source/Python/Common/DecClassObject.py

Summary

Maintainability
F
1 wk
Test Coverage

Function LoadDecFile has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
Open

    def LoadDecFile(self, Filename):
        #
        # Insert a record for file
        #
        Filename = NormPath(Filename)
Severity: Minor
Found in BaseTools/Source/Python/Common/DecClassObject.py - About 6 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 GenPcds has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    def GenPcds(self, ContainerFile):
        EdkLogger.debug(2, "Generate %s ..." % TAB_PCDS)
        Pcds = {}
        PcdToken = {}
        #
Severity: Minor
Found in BaseTools/Source/Python/Common/DecClassObject.py - About 4 hrs to fix

Cognitive Complexity

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

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

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

Further reading

File DecClassObject.py has 292 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# This file is used to define each component of DEC file
#
# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
Severity: Minor
Found in BaseTools/Source/Python/Common/DecClassObject.py - About 3 hrs to fix

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

        def GenLibraryClasses(self, ContainerFile):
            EdkLogger.debug(2, "Generate %s ..." % TAB_LIBRARY_CLASSES)
            LibraryClasses = {}
            #
            # Get all Guids
    Severity: Minor
    Found in BaseTools/Source/Python/Common/DecClassObject.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 GenGuidProtocolPpis has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def GenGuidProtocolPpis(self, Type, ContainerFile):
            EdkLogger.debug(2, "Generate %s ..." % Type)
            Lists = {}
            #
            # Get all Items
    Severity: Minor
    Found in BaseTools/Source/Python/Common/DecClassObject.py - About 1 hr to fix

    Cognitive Complexity

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

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

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

    Further reading

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

        def __init__(self, Filename=None, IsToDatabase=False, IsToPackage=False, WorkspaceDir=None, Database=None, SupArchList=DataType.ARCH_LIST):
    Severity: Minor
    Found in BaseTools/Source/Python/Common/DecClassObject.py - About 45 mins to fix

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

          def GenIncludes(self, ContainerFile):
              EdkLogger.debug(2, "Generate %s ..." % TAB_INCLUDES)
              Includes = {}
              #
              # Get all Includes
      Severity: Minor
      Found in BaseTools/Source/Python/Common/DecClassObject.py - About 45 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

      Avoid deeply nested control flow statements.
      Open

                              if ItemList[1] != '' and ItemList[1].upper() not in ARCH_LIST_FULL:
                                  EdkLogger.error("Parser", PARSER_ERROR, "Invalid Arch definition '%s' found" % ItemList[1], File=Filename, Line=LineNo, RaiseError=EdkLogger.IsRaiseError)
                              ArchList.append(ItemList[1].upper())
      Severity: Major
      Found in BaseTools/Source/Python/Common/DecClassObject.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if CurrentSection != ItemList[0]:
                                    EdkLogger.error("Parser", PARSER_ERROR, "Different section names '%s' and '%s' are found in one section definition, this is not allowed." % (CurrentSection, ItemList[0]), File=Filename, Line=LineNo, RaiseError=EdkLogger.IsRaiseError)
                            if CurrentSection.upper() not in self.KeyList:
        Severity: Major
        Found in BaseTools/Source/Python/Common/DecClassObject.py - About 45 mins to fix

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

              def ShowPackage(self):
                  M = self.Package
                  for Arch in M.Header.keys():
                      print '\nArch =', Arch
                      print 'Filename =', M.Header[Arch].FileName
          Severity: Minor
          Found in BaseTools/Source/Python/Common/DecClassObject.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

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

                  for Record in RecordSet:
                      ValueList = GetSplitValueList(Record[0], TAB_EQUAL_SPLIT)
                      if len(ValueList) != 2:
                          RaiseParserError(Record[0], 'Defines', ContainerFile, '<Key> = <Value>', Record[2])
                      ID, Value1, Value2, Arch, LineNo = Record[3], ValueList[0], ValueList[1], Record[1], Record[2]
          Severity: Major
          Found in BaseTools/Source/Python/Common/DecClassObject.py and 1 other location - About 1 day to fix
          BaseTools/Source/Python/Common/InfClassObject.py on lines 538..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 145.

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

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

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

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

          Refactorings

          Further Reading

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

                  for Arch in self.SupArchList:
                      for Record in RecordSet:
                          if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
                              (Name, Value) = GetGuidsProtocolsPpisOfDec(Record[0], Type, ContainerFile, Record[2])
                              MergeArches(Lists, (Name, Value), Arch)
          Severity: Major
          Found in BaseTools/Source/Python/Common/DecClassObject.py and 1 other location - About 1 day to fix
          BaseTools/Source/Python/Common/InfClassObject.py on lines 1072..1080

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

          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

                      for Record in RecordSet3:
                          if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
                              (TokenGuidCName, TokenName, Value, DatumType, Token, Type) = GetPcdOfDec(Record[0], TAB_PCDS_FEATURE_FLAG, ContainerFile, Record[2])
                              MergeArches(Pcds, (TokenGuidCName, TokenName, Value, DatumType, Token, Type), Arch)
                              PcdToken[Record[3]] = (TokenGuidCName, TokenName)
          Severity: Major
          Found in BaseTools/Source/Python/Common/DecClassObject.py and 4 other locations - About 6 hrs to fix
          BaseTools/Source/Python/Common/DecClassObject.py on lines 468..472
          BaseTools/Source/Python/Common/DecClassObject.py on lines 473..477
          BaseTools/Source/Python/Common/DecClassObject.py on lines 483..487
          BaseTools/Source/Python/Common/DecClassObject.py on lines 488..492

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

          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

                      for Record in RecordSet1:
                          if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
                              (TokenGuidCName, TokenName, Value, DatumType, Token, Type) = GetPcdOfDec(Record[0], TAB_PCDS_FIXED_AT_BUILD, ContainerFile, Record[2])
                              MergeArches(Pcds, (TokenGuidCName, TokenName, Value, DatumType, Token, Type), Arch)
                              PcdToken[Record[3]] = (TokenGuidCName, TokenName)
          Severity: Major
          Found in BaseTools/Source/Python/Common/DecClassObject.py and 4 other locations - About 6 hrs to fix
          BaseTools/Source/Python/Common/DecClassObject.py on lines 473..477
          BaseTools/Source/Python/Common/DecClassObject.py on lines 478..482
          BaseTools/Source/Python/Common/DecClassObject.py on lines 483..487
          BaseTools/Source/Python/Common/DecClassObject.py on lines 488..492

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

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

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

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

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

          Refactorings

          Further Reading

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

          if __name__ == '__main__':
              EdkLogger.Initialize()
              EdkLogger.SetLevel(EdkLogger.DEBUG_0)
          
              W = os.getenv('WORKSPACE')
          Severity: Major
          Found in BaseTools/Source/Python/Common/DecClassObject.py and 2 other locations - About 6 hrs to fix
          BaseTools/Source/Python/Common/DscClassObject.py on lines 1426..1439
          BaseTools/Source/Python/Common/InfClassObject.py on lines 1102..1115

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 106.

          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

                      for Record in RecordSet4:
                          if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
                              (TokenGuidCName, TokenName, Value, DatumType, Token, Type) = GetPcdOfDec(Record[0], TAB_PCDS_DYNAMIC_EX, ContainerFile, Record[2])
                              MergeArches(Pcds, (TokenGuidCName, TokenName, Value, DatumType, Token, Type), Arch)
                              PcdToken[Record[3]] = (TokenGuidCName, TokenName)
          Severity: Major
          Found in BaseTools/Source/Python/Common/DecClassObject.py and 4 other locations - About 6 hrs to fix
          BaseTools/Source/Python/Common/DecClassObject.py on lines 468..472
          BaseTools/Source/Python/Common/DecClassObject.py on lines 473..477
          BaseTools/Source/Python/Common/DecClassObject.py on lines 478..482
          BaseTools/Source/Python/Common/DecClassObject.py on lines 488..492

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

          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

                      for Record in RecordSet2:
                          if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
                              (TokenGuidCName, TokenName, Value, DatumType, Token, Type) = GetPcdOfDec(Record[0], TAB_PCDS_PATCHABLE_IN_MODULE, ContainerFile, Record[2])
                              MergeArches(Pcds, (TokenGuidCName, TokenName, Value, DatumType, Token, Type), Arch)
                              PcdToken[Record[3]] = (TokenGuidCName, TokenName)
          Severity: Major
          Found in BaseTools/Source/Python/Common/DecClassObject.py and 4 other locations - About 6 hrs to fix
          BaseTools/Source/Python/Common/DecClassObject.py on lines 468..472
          BaseTools/Source/Python/Common/DecClassObject.py on lines 478..482
          BaseTools/Source/Python/Common/DecClassObject.py on lines 483..487
          BaseTools/Source/Python/Common/DecClassObject.py on lines 488..492

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

          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

                      for Record in RecordSet5:
                          if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
                              (TokenGuidCName, TokenName, Value, DatumType, Token, Type) = GetPcdOfDec(Record[0], TAB_PCDS_DYNAMIC, ContainerFile, Record[2])
                              MergeArches(Pcds, (TokenGuidCName, TokenName, Value, DatumType, Token, Type), Arch)
                              PcdToken[Record[3]] = (TokenGuidCName, TokenName)
          Severity: Major
          Found in BaseTools/Source/Python/Common/DecClassObject.py and 4 other locations - About 6 hrs to fix
          BaseTools/Source/Python/Common/DecClassObject.py on lines 468..472
          BaseTools/Source/Python/Common/DecClassObject.py on lines 473..477
          BaseTools/Source/Python/Common/DecClassObject.py on lines 478..482
          BaseTools/Source/Python/Common/DecClassObject.py on lines 483..487

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

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

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

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

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

          Refactorings

          Further Reading

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

                  if self.IsToDatabase:
                      for Key in PcdToken.keys():
                          SqlCommand = """update %s set Value2 = '%s' where ID = %s""" % (self.TblDec.Table, ".".join((PcdToken[Key][0], PcdToken[Key][1])), Key)
                          self.TblDec.Exec(SqlCommand)
          Severity: Major
          Found in BaseTools/Source/Python/Common/DecClassObject.py and 1 other location - About 4 hrs to fix
          BaseTools/Source/Python/Common/InfClassObject.py on lines 921..924

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

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

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

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

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

          Refactorings

          Further Reading

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

                  for Arch in self.SupArchList:
                      for Record in RecordSet:
                          if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
                              MergeArches(Includes, Record[0], Arch)
          Severity: Major
          Found in BaseTools/Source/Python/Common/DecClassObject.py and 3 other locations - About 3 hrs to fix
          BaseTools/Source/Python/Common/InfClassObject.py on lines 691..694
          BaseTools/Source/Python/Common/InfClassObject.py on lines 720..723
          BaseTools/Source/Python/Common/InfClassObject.py on lines 828..831

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

          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 Type == TAB_GUIDS:
                      ListMember = self.Package.GuidDeclarations
                  elif Type == TAB_PROTOCOLS:
                      ListMember = self.Package.ProtocolDeclarations
                  elif Type == TAB_PPIS:
          Severity: Major
          Found in BaseTools/Source/Python/Common/DecClassObject.py and 1 other location - About 2 hrs to fix
          BaseTools/Source/Python/Common/InfClassObject.py on lines 1083..1088

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

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

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

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

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

          Refactorings

          Further Reading

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

                  for Key in Includes.keys():
                      Include = IncludeClass()
                      Include.FilePath = NormPath(Key)
                      Include.SupArchList = Includes[Key]
                      self.Package.Includes.append(Include)
          Severity: Major
          Found in BaseTools/Source/Python/Common/DecClassObject.py and 1 other location - About 2 hrs to fix
          BaseTools/Source/Python/Common/InfClassObject.py on lines 696..700

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 54.

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

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

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

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

          Refactorings

          Further Reading

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

                      if Line.find(TAB_COMMENT_EDK_END) > -1:
                          Line = ReservedLine + GetSplitList(Line, TAB_COMMENT_EDK_END, 1)[1]
                          ReservedLine = ''
                          IsFindBlockComment = False
          Severity: Major
          Found in BaseTools/Source/Python/Common/DecClassObject.py and 3 other locations - About 1 hr to fix
          BaseTools/Source/Python/Common/DscClassObject.py on lines 1051..1054
          BaseTools/Source/Python/Common/InfClassObject.py on lines 358..361
          BaseTools/Source/Python/Eot/Parser.py on lines 56..59

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

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

                      if CurrentSection == TAB_UNKNOWN:
                          ErrorMsg = "%s is not in any defined section" % Line
                          EdkLogger.error("Parser", PARSER_ERROR, ErrorMsg, File=Filename, Line=LineNo, RaiseError=EdkLogger.IsRaiseError)
          Severity: Major
          Found in BaseTools/Source/Python/Common/DecClassObject.py and 2 other locations - About 1 hr to fix
          BaseTools/Source/Python/Common/DscClassObject.py on lines 1110..1112
          BaseTools/Source/Python/Common/InfClassObject.py on lines 420..422

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

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

                      if Line.find(TAB_COMMENT_EDK_START) > -1:
                          ReservedLine = GetSplitList(Line, TAB_COMMENT_EDK_START, 1)[0]
                          IsFindBlockComment = True
          Severity: Major
          Found in BaseTools/Source/Python/Common/DecClassObject.py and 3 other locations - About 1 hr to fix
          BaseTools/Source/Python/Common/DscClassObject.py on lines 1048..1050
          BaseTools/Source/Python/Common/InfClassObject.py on lines 355..357
          BaseTools/Source/Python/Eot/Parser.py on lines 53..55

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 38.

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

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

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

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

          Refactorings

          Further Reading

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

                          LineList = GetSplitValueList(Line[len(TAB_SECTION_START):len(Line) - len(TAB_SECTION_END)], TAB_COMMA_SPLIT)
          Severity: Major
          Found in BaseTools/Source/Python/Common/DecClassObject.py and 3 other locations - About 50 mins to fix
          BaseTools/Source/Python/Common/DscClassObject.py on lines 1083..1083
          BaseTools/Source/Python/Common/InfClassObject.py on lines 393..393
          BaseTools/Source/Python/Eot/InfParserLite.py on lines 129..129

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 36.

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

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

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

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

          Refactorings

          Further Reading

          There are no issues that match your filters.

          Category
          Status