hackedteam/vector-edk

View on GitHub
BaseTools/Source/Python/Ecc/CodeFragmentCollector.py

Summary

Maintainability
F
2 wks
Test Coverage

Function PreprocessFile has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
Open

    def PreprocessFile(self):

        self.Rewind()
        InComment = False
        DoubleSlashComment = False
Severity: Minor
Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.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 PreprocessFileWithClear has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
Open

    def PreprocessFileWithClear(self):

        self.Rewind()
        InComment = False
        DoubleSlashComment = False
Severity: Minor
Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.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 CodeFragmentCollector.py has 376 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# preprocess source file
#
#  Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
#
Severity: Minor
Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py - About 5 hrs to fix

    Consider simplifying this complex logical expression.
    Open

                if self.__CurrentChar() == T_CHAR_LF:
                    if HashComment and PPDirectiveObj != None:
                        if PPDirectiveObj.Content.rstrip(T_CHAR_CR).endswith(T_CHAR_BACKSLASH):
                            PPDirectiveObj.Content += T_CHAR_LF
                            PPExtend = True
    Severity: Critical
    Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

                  if self.__CurrentChar() == T_CHAR_LF:
                      if HashComment and PPDirectiveObj != None:
                          if PPDirectiveObj.Content.rstrip(T_CHAR_CR).endswith(T_CHAR_BACKSLASH):
                              PPDirectiveObj.Content += T_CHAR_LF
                              PPExtend = True
      Severity: Critical
      Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py - About 1 hr to fix

        Function PrintFragments has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def PrintFragments(self):
                
                print '################# ' + self.FileName + '#####################'
                
                print '/****************************************/'
        Severity: Minor
        Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py - About 1 hr to fix

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

              def __InsertComma(self, Line):
                  
                  
                  if self.Profile.FileLinesList[Line - 1][0] != T_CHAR_HASH:
                      BeforeHashPart = str(self.Profile.FileLinesList[Line - 1]).split(T_CHAR_HASH)[0]
          Severity: Minor
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.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 PrintFragments has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def PrintFragments(self):
                  
                  print '################# ' + self.FileName + '#####################'
                  
                  print '/****************************************/'
          Severity: Minor
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.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

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

              def __InsertComma(self, Line):
                  
                  
                  if self.Profile.FileLinesList[Line - 1][0] != T_CHAR_HASH:
                      BeforeHashPart = str(self.Profile.FileLinesList[Line - 1]).split(T_CHAR_HASH)[0]
          Severity: Major
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 1 other location - About 2 days to fix
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 247..264

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

          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.__CurrentChar() == T_CHAR_LF:
                          if HashComment and PPDirectiveObj != None:
                              if PPDirectiveObj.Content.rstrip(T_CHAR_CR).endswith(T_CHAR_BACKSLASH):
                                  PPDirectiveObj.Content += T_CHAR_LF
                                  PPExtend = True
          Severity: Major
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 1 other location - About 2 days to fix
          BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 425..459

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

          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.__CurrentChar() == T_CHAR_LF:
                          if HashComment and PPDirectiveObj != None:
                              if PPDirectiveObj.Content.rstrip(T_CHAR_CR).endswith(T_CHAR_BACKSLASH):
                                  PPDirectiveObj.Content += T_CHAR_LF
                                  PPExtend = True
          Severity: Major
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 1 other location - About 2 days to fix
          BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 303..337

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

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

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

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

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

          Refactorings

          Further Reading

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

              def ParseFileWithClearedPPDirective(self):
                  self.PreprocessFileWithClear()
                  # restore from ListOfList to ListOfString
                  self.Profile.FileLinesList = ["".join(list) for list in self.Profile.FileLinesList]
                  FileStringContents = ''
          Severity: Major
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 2 other locations - About 6 hrs to fix
          BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 531..542
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 382..393

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

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

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

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

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

          Refactorings

          Further Reading

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

              def ParseFile(self):
                  self.PreprocessFile()
                  # restore from ListOfList to ListOfString
                  self.Profile.FileLinesList = ["".join(list) for list in self.Profile.FileLinesList]
                  FileStringContents = ''
          Severity: Major
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 2 other locations - About 6 hrs to fix
          BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 544..555
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 382..393

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

          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

              def __NextChar(self):
                  if self.CurrentOffsetWithinLine == len(self.Profile.FileLinesList[self.CurrentLineNumber - 1]) - 1:
                      return self.Profile.FileLinesList[self.CurrentLineNumber][0]
                  else:
                      return self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine + 1]
          Severity: Major
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 3 other locations - About 6 hrs to fix
          BaseTools/Source/Python/Common/FdfParserLite.py on lines 307..311
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 204..208
          BaseTools/Source/Python/GenFds/FdfParser.py on lines 360..364

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

          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

              def __UndoOneChar(self):
                  
                  if self.CurrentLineNumber == 1 and self.CurrentOffsetWithinLine == 0:
                      return False
                  elif self.CurrentOffsetWithinLine == 0:
          Severity: Major
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 3 other locations - About 5 hrs to fix
          BaseTools/Source/Python/Common/FdfParserLite.py on lines 266..275
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 161..170
          BaseTools/Source/Python/GenFds/FdfParser.py on lines 319..328

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

          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 self.__CurrentChar() == T_CHAR_SLASH and self.__NextChar() == T_CHAR_SLASH:
                                  InComment = False
                                  HashComment = False
                                  PPDirectiveObj.EndPos = (self.CurrentLineNumber, self.CurrentOffsetWithinLine - 1)
                                  FileProfile.PPDirectiveList.append(PPDirectiveObj)
          Severity: Major
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 2 other locations - About 5 hrs to fix
          BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 474..484
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 333..343

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

          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 HashComment:
                              # // follows hash PP directive
                              if self.__CurrentChar() == T_CHAR_SLASH and self.__NextChar() == T_CHAR_SLASH:
                                  InComment = False
                                  HashComment = False
          Severity: Major
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 2 other locations - About 5 hrs to fix
          BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 354..362
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 333..343

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

          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

              def __SkipWhiteSpace(self):
                  Count = 0
                  while not self.__EndOfFile():
                      Count += 1
                      if self.__CurrentChar() in (T_CHAR_NULL, T_CHAR_CR, T_CHAR_LF, T_CHAR_SPACE, T_CHAR_TAB):
          Severity: Major
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 3 other locations - About 5 hrs to fix
          BaseTools/Source/Python/Common/FdfParserLite.py on lines 201..211
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 98..108
          BaseTools/Source/Python/GenFds/FdfParser.py on lines 254..264

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

          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

              def __GetOneChar(self):
                  if self.CurrentOffsetWithinLine == len(self.Profile.FileLinesList[self.CurrentLineNumber - 1]) - 1:
                          self.CurrentLineNumber += 1
                          self.CurrentOffsetWithinLine = 0
                  else:
          Severity: Major
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 3 other locations - About 3 hrs to fix
          BaseTools/Source/Python/Common/FdfParserLite.py on lines 283..288
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 178..183
          BaseTools/Source/Python/GenFds/FdfParser.py on lines 336..341

          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

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

              def __init__(self, FileName):
                  self.Profile = FileProfile.FileProfile(FileName)
                  self.Profile.FileLinesList.append(T_CHAR_LF)
                  self.FileName = FileName
                  self.CurrentLineNumber = 1
          Severity: Major
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 1 other location - About 3 hrs to fix
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 66..74

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 68.

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

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

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

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

          Refactorings

          Further Reading

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

              def __EndOfLine(self):
                  SizeOfCurrentLine = len(self.Profile.FileLinesList[self.CurrentLineNumber - 1])
                  if self.CurrentOffsetWithinLine >= SizeOfCurrentLine - 1:
                      return True
                  else:
          Severity: Major
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 1 other location - About 2 hrs to fix
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 136..141

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

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

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

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

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

          Refactorings

          Further Reading

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

                  for func in FileProfile.FunctionDefinitionList:
                      print str(func.StartPos) + func.Modifier + ' '+ func.Declarator + ' ' + str(func.NamePos)
          Severity: Major
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 1 other location - About 2 hrs to fix
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 439..440

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

          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

              def __CurrentChar(self):
                  CurrentChar = self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine]
          #        if CurrentChar > 255:
          #            raise Warning("Non-Ascii char found At Line %d, offset %d" % (self.CurrentLineNumber, self.CurrentOffsetWithinLine), self.FileName, self.CurrentLineNumber)
                  return CurrentChar
          Severity: Major
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 1 other location - About 1 hr to fix
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 192..195

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

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

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

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

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

          Refactorings

          Further Reading

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

                  for var in FileProfile.VariableDeclarationList:
                      print str(var.StartPos) + var.Modifier + ' '+ var.Declarator
          Severity: Major
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 1 other location - About 1 hr to fix
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 433..434

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 39.

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

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

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

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

          Refactorings

          Further Reading

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

              def __SetCurrentCharValue(self, Value):
                  self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine] = Value
          Severity: Major
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 3 other locations - About 1 hr to fix
          BaseTools/Source/Python/Common/FdfParserLite.py on lines 320..321
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 217..218
          BaseTools/Source/Python/GenFds/FdfParser.py on lines 373..374

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

              def __SetCharValue(self, Line, Offset, Value):
                  self.Profile.FileLinesList[Line - 1][Offset] = Value
          Severity: Minor
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 1 other location - About 50 mins to fix
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 227..228

          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

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

                  if InComment and HashComment and not PPExtend:
                      PPDirectiveObj.EndPos = EndLinePos
                      FileProfile.PPDirectiveList.append(PPDirectiveObj)
          Severity: Minor
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 2 other locations - About 30 mins to fix
          BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 519..521
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 370..372

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

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

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

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

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

          Refactorings

          Further Reading

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

                      if not InComment and self.__CurrentChar() == T_CHAR_DOUBLE_QUOTE:
                          InString = not InString
          Severity: Major
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 5 other locations - About 30 mins to fix
          BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 300..301
          BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 419..420
          BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 422..423
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 287..288
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 290..291

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

          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 InComment and HashComment and not PPExtend:
                      PPDirectiveObj.EndPos = EndLinePos
                      FileProfile.PPDirectiveList.append(PPDirectiveObj)
          Severity: Minor
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 2 other locations - About 30 mins to fix
          BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 397..399
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 370..372

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

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

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

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

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

          Refactorings

          Further Reading

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

                      if not InComment and self.__CurrentChar() == T_CHAR_SINGLE_QUOTE:
                          InCharLiteral = not InCharLiteral
          Severity: Major
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 5 other locations - About 30 mins to fix
          BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 297..298
          BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 419..420
          BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 422..423
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 287..288
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 290..291

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

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

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

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

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

          Refactorings

          Further Reading

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

                      if not InComment and self.__CurrentChar() == T_CHAR_SINGLE_QUOTE:
                          InCharLiteral = not InCharLiteral
          Severity: Major
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 5 other locations - About 30 mins to fix
          BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 297..298
          BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 300..301
          BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 419..420
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 287..288
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 290..291

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

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

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

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

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

          Refactorings

          Further Reading

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

                      if not InComment and self.__CurrentChar() == T_CHAR_DOUBLE_QUOTE:
                          InString = not InString
          Severity: Major
          Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 5 other locations - About 30 mins to fix
          BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 297..298
          BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 300..301
          BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 422..423
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 287..288
          BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 290..291

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

          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