hackedteam/vector-edk

View on GitHub
vector-uefi/fd/tool/chipsec/logger.py

Summary

Maintainability
D
2 days
Test Coverage

Logger has 36 functions (exceeds 20 allowed). Consider refactoring.
Open

class Logger:
    """Class for logging to console, text file or XML."""

    def __init__( self ):
        """The Constructor."""
Severity: Minor
Found in vector-uefi/fd/tool/chipsec/logger.py - About 4 hrs to fix

    File logger.py has 305 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    #!/usr/local/bin/python
    #CHIPSEC: Platform Security Assessment Framework
    #Copyright (c) 2010-2014, Intel Corporation
    # 
    #This program is free software; you can redistribute it and/or
    Severity: Minor
    Found in vector-uefi/fd/tool/chipsec/logger.py - About 3 hrs to fix

      Function _log has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def _log(self, text, color, isStatus):
              """Internal method for logging"""
              if self.LOG_TO_FILE: self._save_to_log_file( text )
              else:              
                  if color: log_color( color, text )
      Severity: Minor
      Found in vector-uefi/fd/tool/chipsec/logger.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 print_buffer has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      def print_buffer( arr, length = 16 ):
          """Prints the buffer."""
          tmp=[]
          tmp_str=[]
          i=1
      Severity: Minor
      Found in vector-uefi/fd/tool/chipsec/logger.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

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

      def dump_buffer( arr, length = 8 ):
          """Dumps the buffer."""
          tmp=[]
          tmp_str=[]
          i=1
      Severity: Minor
      Found in vector-uefi/fd/tool/chipsec/logger.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

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

              tmp+=[ (length - len(arr)%length) * 3*" " ]
      Severity: Minor
      Found in vector-uefi/fd/tool/chipsec/logger.py and 1 other location - About 55 mins to fix
      vector-uefi/fd/tool/chipsec/logger.py on lines 438..438

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

      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.ALWAYS_FLUSH:
                 # not sure why flush doesn't work as excpected
                 # self.logfile.flush()
                 # close and re-open log file
                 try:
      Severity: Minor
      Found in vector-uefi/fd/tool/chipsec/logger.py and 1 other location - About 55 mins to fix
      vector-uefi/fd/tool/chipsec/logger.py on lines 194..202

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

      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

              tmp+=[ (length - len(arr)%length) * 3*" " ]
      Severity: Minor
      Found in vector-uefi/fd/tool/chipsec/logger.py and 1 other location - About 55 mins to fix
      vector-uefi/fd/tool/chipsec/logger.py on lines 410..410

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

      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.LOG_TO_FILE and self.logfile is not None:
                 # not sure why flush doesn't work as excpected
                 # self.logfile.flush()
                 # close and re-open log file
                 try:
      Severity: Minor
      Found in vector-uefi/fd/tool/chipsec/logger.py and 1 other location - About 55 mins to fix
      vector-uefi/fd/tool/chipsec/logger.py on lines 352..360

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

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

          def log_unknown( self, text ):
              """Logs a message with a question mark."""
              text = "[?] " + text
              self._log(text, None, None)
      Severity: Major
      Found in vector-uefi/fd/tool/chipsec/logger.py and 10 other locations - About 30 mins to fix
      vector-uefi/fd/tool/chipsec/logger.py on lines 224..227
      vector-uefi/fd/tool/chipsec/logger.py on lines 229..232
      vector-uefi/fd/tool/chipsec/logger.py on lines 269..272
      vector-uefi/fd/tool/chipsec/logger.py on lines 274..277
      vector-uefi/fd/tool/chipsec/logger.py on lines 279..282
      vector-uefi/fd/tool/chipsec/logger.py on lines 285..288
      vector-uefi/fd/tool/chipsec/logger.py on lines 294..297
      vector-uefi/fd/tool/chipsec/logger.py on lines 299..302
      vector-uefi/fd/tool/chipsec/logger.py on lines 304..307
      vector-uefi/fd/tool/chipsec/logger.py on lines 309..312

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

          def log_warning( self, text ):
              """Logs a Warning message"""
              text = "[!] WARNING: " + text
              self._log(text, YELLOW, None)
      Severity: Major
      Found in vector-uefi/fd/tool/chipsec/logger.py and 10 other locations - About 30 mins to fix
      vector-uefi/fd/tool/chipsec/logger.py on lines 224..227
      vector-uefi/fd/tool/chipsec/logger.py on lines 229..232
      vector-uefi/fd/tool/chipsec/logger.py on lines 269..272
      vector-uefi/fd/tool/chipsec/logger.py on lines 274..277
      vector-uefi/fd/tool/chipsec/logger.py on lines 285..288
      vector-uefi/fd/tool/chipsec/logger.py on lines 294..297
      vector-uefi/fd/tool/chipsec/logger.py on lines 299..302
      vector-uefi/fd/tool/chipsec/logger.py on lines 304..307
      vector-uefi/fd/tool/chipsec/logger.py on lines 309..312
      vector-uefi/fd/tool/chipsec/logger.py on lines 314..317

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

          def warn( self, text ):
              """Logs an Warning message"""
              text = "WARNING: " + text
              self._log(text, YELLOW, None)
      Severity: Major
      Found in vector-uefi/fd/tool/chipsec/logger.py and 10 other locations - About 30 mins to fix
      vector-uefi/fd/tool/chipsec/logger.py on lines 224..227
      vector-uefi/fd/tool/chipsec/logger.py on lines 269..272
      vector-uefi/fd/tool/chipsec/logger.py on lines 274..277
      vector-uefi/fd/tool/chipsec/logger.py on lines 279..282
      vector-uefi/fd/tool/chipsec/logger.py on lines 285..288
      vector-uefi/fd/tool/chipsec/logger.py on lines 294..297
      vector-uefi/fd/tool/chipsec/logger.py on lines 299..302
      vector-uefi/fd/tool/chipsec/logger.py on lines 304..307
      vector-uefi/fd/tool/chipsec/logger.py on lines 309..312
      vector-uefi/fd/tool/chipsec/logger.py on lines 314..317

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

          def error( self, text ):
              """Logs an Error message"""
              text = "ERROR: " + text
              self._log(text, RED, None)
      Severity: Major
      Found in vector-uefi/fd/tool/chipsec/logger.py and 10 other locations - About 30 mins to fix
      vector-uefi/fd/tool/chipsec/logger.py on lines 229..232
      vector-uefi/fd/tool/chipsec/logger.py on lines 269..272
      vector-uefi/fd/tool/chipsec/logger.py on lines 274..277
      vector-uefi/fd/tool/chipsec/logger.py on lines 279..282
      vector-uefi/fd/tool/chipsec/logger.py on lines 285..288
      vector-uefi/fd/tool/chipsec/logger.py on lines 294..297
      vector-uefi/fd/tool/chipsec/logger.py on lines 299..302
      vector-uefi/fd/tool/chipsec/logger.py on lines 304..307
      vector-uefi/fd/tool/chipsec/logger.py on lines 309..312
      vector-uefi/fd/tool/chipsec/logger.py on lines 314..317

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

          def log_important( self, text ):
              """Logs a important message."""
              text = "[!] " + text
              self._log(text, RED, None)
      Severity: Major
      Found in vector-uefi/fd/tool/chipsec/logger.py and 10 other locations - About 30 mins to fix
      vector-uefi/fd/tool/chipsec/logger.py on lines 224..227
      vector-uefi/fd/tool/chipsec/logger.py on lines 229..232
      vector-uefi/fd/tool/chipsec/logger.py on lines 269..272
      vector-uefi/fd/tool/chipsec/logger.py on lines 274..277
      vector-uefi/fd/tool/chipsec/logger.py on lines 279..282
      vector-uefi/fd/tool/chipsec/logger.py on lines 285..288
      vector-uefi/fd/tool/chipsec/logger.py on lines 299..302
      vector-uefi/fd/tool/chipsec/logger.py on lines 304..307
      vector-uefi/fd/tool/chipsec/logger.py on lines 309..312
      vector-uefi/fd/tool/chipsec/logger.py on lines 314..317

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

          def log_failed( self, text ):
              """Logs a failed message."""
              text = "[-] FAILED: " + text
              self._log(text, RED, True)
      Severity: Major
      Found in vector-uefi/fd/tool/chipsec/logger.py and 10 other locations - About 30 mins to fix
      vector-uefi/fd/tool/chipsec/logger.py on lines 224..227
      vector-uefi/fd/tool/chipsec/logger.py on lines 229..232
      vector-uefi/fd/tool/chipsec/logger.py on lines 269..272
      vector-uefi/fd/tool/chipsec/logger.py on lines 279..282
      vector-uefi/fd/tool/chipsec/logger.py on lines 285..288
      vector-uefi/fd/tool/chipsec/logger.py on lines 294..297
      vector-uefi/fd/tool/chipsec/logger.py on lines 299..302
      vector-uefi/fd/tool/chipsec/logger.py on lines 304..307
      vector-uefi/fd/tool/chipsec/logger.py on lines 309..312
      vector-uefi/fd/tool/chipsec/logger.py on lines 314..317

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

          def log_skipped( self, text ):
              """Logs a skipped message."""
              text = "[*] SKIPPED: " + text
              self._log(text, YELLOW, True)
      Severity: Major
      Found in vector-uefi/fd/tool/chipsec/logger.py and 10 other locations - About 30 mins to fix
      vector-uefi/fd/tool/chipsec/logger.py on lines 224..227
      vector-uefi/fd/tool/chipsec/logger.py on lines 229..232
      vector-uefi/fd/tool/chipsec/logger.py on lines 269..272
      vector-uefi/fd/tool/chipsec/logger.py on lines 274..277
      vector-uefi/fd/tool/chipsec/logger.py on lines 279..282
      vector-uefi/fd/tool/chipsec/logger.py on lines 294..297
      vector-uefi/fd/tool/chipsec/logger.py on lines 299..302
      vector-uefi/fd/tool/chipsec/logger.py on lines 304..307
      vector-uefi/fd/tool/chipsec/logger.py on lines 309..312
      vector-uefi/fd/tool/chipsec/logger.py on lines 314..317

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

          def log_good( self, text ):
              """Logs a message, if colors available, displays in green."""
              text = "[+] " + text
              self._log(text, GREEN, None)
      Severity: Major
      Found in vector-uefi/fd/tool/chipsec/logger.py and 10 other locations - About 30 mins to fix
      vector-uefi/fd/tool/chipsec/logger.py on lines 224..227
      vector-uefi/fd/tool/chipsec/logger.py on lines 229..232
      vector-uefi/fd/tool/chipsec/logger.py on lines 269..272
      vector-uefi/fd/tool/chipsec/logger.py on lines 274..277
      vector-uefi/fd/tool/chipsec/logger.py on lines 279..282
      vector-uefi/fd/tool/chipsec/logger.py on lines 285..288
      vector-uefi/fd/tool/chipsec/logger.py on lines 294..297
      vector-uefi/fd/tool/chipsec/logger.py on lines 299..302
      vector-uefi/fd/tool/chipsec/logger.py on lines 304..307
      vector-uefi/fd/tool/chipsec/logger.py on lines 314..317

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

          def log_result( self, text ):
              """Logs a result message."""
              text = "[+] " + text
              self._log(text, GREEN, None)
      Severity: Major
      Found in vector-uefi/fd/tool/chipsec/logger.py and 10 other locations - About 30 mins to fix
      vector-uefi/fd/tool/chipsec/logger.py on lines 224..227
      vector-uefi/fd/tool/chipsec/logger.py on lines 229..232
      vector-uefi/fd/tool/chipsec/logger.py on lines 269..272
      vector-uefi/fd/tool/chipsec/logger.py on lines 274..277
      vector-uefi/fd/tool/chipsec/logger.py on lines 279..282
      vector-uefi/fd/tool/chipsec/logger.py on lines 285..288
      vector-uefi/fd/tool/chipsec/logger.py on lines 294..297
      vector-uefi/fd/tool/chipsec/logger.py on lines 304..307
      vector-uefi/fd/tool/chipsec/logger.py on lines 309..312
      vector-uefi/fd/tool/chipsec/logger.py on lines 314..317

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

          def log_bad( self, text ):
              """Logs a bad message, so it calls attention in the information displayed."""
              text = "[-] " + text
              self._log(text, RED, None)
      Severity: Major
      Found in vector-uefi/fd/tool/chipsec/logger.py and 10 other locations - About 30 mins to fix
      vector-uefi/fd/tool/chipsec/logger.py on lines 224..227
      vector-uefi/fd/tool/chipsec/logger.py on lines 229..232
      vector-uefi/fd/tool/chipsec/logger.py on lines 269..272
      vector-uefi/fd/tool/chipsec/logger.py on lines 274..277
      vector-uefi/fd/tool/chipsec/logger.py on lines 279..282
      vector-uefi/fd/tool/chipsec/logger.py on lines 285..288
      vector-uefi/fd/tool/chipsec/logger.py on lines 294..297
      vector-uefi/fd/tool/chipsec/logger.py on lines 299..302
      vector-uefi/fd/tool/chipsec/logger.py on lines 309..312
      vector-uefi/fd/tool/chipsec/logger.py on lines 314..317

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

          def log_passed( self, text ):
              """Logs a passed message."""
              text = "[+] PASSED: " + text
              self._log(text, GREEN, True)
      Severity: Major
      Found in vector-uefi/fd/tool/chipsec/logger.py and 10 other locations - About 30 mins to fix
      vector-uefi/fd/tool/chipsec/logger.py on lines 224..227
      vector-uefi/fd/tool/chipsec/logger.py on lines 229..232
      vector-uefi/fd/tool/chipsec/logger.py on lines 274..277
      vector-uefi/fd/tool/chipsec/logger.py on lines 279..282
      vector-uefi/fd/tool/chipsec/logger.py on lines 285..288
      vector-uefi/fd/tool/chipsec/logger.py on lines 294..297
      vector-uefi/fd/tool/chipsec/logger.py on lines 299..302
      vector-uefi/fd/tool/chipsec/logger.py on lines 304..307
      vector-uefi/fd/tool/chipsec/logger.py on lines 309..312
      vector-uefi/fd/tool/chipsec/logger.py on lines 314..317

      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