christoph2/pyBDM

View on GitHub
pyBDM/bdm.py

Summary

Maintainability
F
3 days
Test Coverage

BDMBase has 45 functions (exceeds 20 allowed). Consider refactoring.
Open

class BDMBase(object):
    """ .. class:: BDM

        BDM Communication base class.
    """
Severity: Minor
Found in pyBDM/bdm.py - About 6 hrs to fix

    File bdm.py has 357 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    #!/usr/bin/env python
    # -*- coding: utf-8 -*-
    
    __version__ = "0.1.0"
    
    
    Severity: Minor
    Found in pyBDM/bdm.py - About 4 hrs to fix

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

          def readByte(self, addr):
              """ ..  py:method::
              """
              self.logger.debug("READ_BYTE[0x{0:04x}]".format(addr))
              data = self.readCommand(READ_BYTE, 1, addr)[0]
      Severity: Major
      Found in pyBDM/bdm.py and 1 other location - About 3 hrs to fix
      pyBDM/bdm.py on lines 182..188

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

      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

          def readBDByte(self, addr):
              """ ..  py:method::
              """
              self.logger.debug("READ_BD_BYTE[0x{0:04x}]".format(addr))
              data = self.readCommand(READ_BD_BYTE, 1, addr)[0]
      Severity: Major
      Found in pyBDM/bdm.py and 1 other location - About 3 hrs to fix
      pyBDM/bdm.py on lines 190..196

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

      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

          def writeWord(self, addr, data):
              """ ..  py:method::
              """
              self.logger.debug("WRITE_WORD[0x{0:04x}]=0x{1:04x}".format(addr, data))
              super(BDMBase, self).writeWord(WRITE_WORD, addr, data)
      Severity: Major
      Found in pyBDM/bdm.py and 1 other location - About 1 hr to fix
      pyBDM/bdm.py on lines 210..214

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 45.

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

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

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

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

      Refactorings

      Further Reading

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

          def writeByte(self, addr, data):
              """ ..  py:method::
              """
              self.logger.debug("WRITE_BYTE[0x{0:04x}]=0x{1:02x}".format(addr, data))
              super(BDMBase, self).writeByte(WRITE_BYTE, addr, data)
      Severity: Major
      Found in pyBDM/bdm.py and 1 other location - About 1 hr to fix
      pyBDM/bdm.py on lines 216..220

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 45.

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

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

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

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

      Refactorings

      Further Reading

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

          def writeBDByte(self, addr, data):
              """ ..  py:method::
              """
              self.logger.debug("WRITE_BD_BYTE[0x{0:04x}]=0x{1:02x}".format(addr, data))
              self.writeByte(WRITE_BD_BYTE,addr, data)
      Severity: Major
      Found in pyBDM/bdm.py and 1 other location - About 1 hr to fix
      pyBDM/bdm.py on lines 198..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 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

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

          def writeBDWord(self, addr, data):
              """ ..  py:method::
              """
              self.logger.debug("WRITE_BD_WORD[0x{0:04x}]=0x{1:04x}".format(addr, data))
              self.writeWord(WRITE_BD_WORD, addr, data)
      Severity: Major
      Found in pyBDM/bdm.py and 1 other location - About 1 hr to fix
      pyBDM/bdm.py on lines 204..208

      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

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

          def writePC(self, data):
              """ ..  py:method::
              """
              self.logger.debug("WRITE_PC[0x{0:04x}]".format(data))
              self.writeWord(WRITE_PC, data)
      Severity: Major
      Found in pyBDM/bdm.py and 5 other locations - About 55 mins to fix
      pyBDM/bdm.py on lines 228..232
      pyBDM/bdm.py on lines 270..274
      pyBDM/bdm.py on lines 276..280
      pyBDM/bdm.py on lines 282..286
      pyBDM/bdm.py on lines 288..292

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

          def writeSP(self, data):
              """ ..  py:method::
              """
              self.logger.debug("WRITE_SP[0x{0:04x}]".format(data))
              self.writeWord(WRITE_SP, data)
      Severity: Major
      Found in pyBDM/bdm.py and 5 other locations - About 55 mins to fix
      pyBDM/bdm.py on lines 228..232
      pyBDM/bdm.py on lines 264..268
      pyBDM/bdm.py on lines 270..274
      pyBDM/bdm.py on lines 276..280
      pyBDM/bdm.py on lines 282..286

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

          def writeX(self, data):
              """ ..  py:method::
              """
              self.logger.debug("WRITE_X[0x{0:04x}]".format(data))
              self.writeWord(WRITE_X, data)
      Severity: Major
      Found in pyBDM/bdm.py and 5 other locations - About 55 mins to fix
      pyBDM/bdm.py on lines 228..232
      pyBDM/bdm.py on lines 264..268
      pyBDM/bdm.py on lines 270..274
      pyBDM/bdm.py on lines 282..286
      pyBDM/bdm.py on lines 288..292

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

          def writeNext(self,data):
              """ ..  py:method::
              """
              self.logger.debug("WRITE_NEXT[0x{0:04x}]".format(data))
              self.writeWord(WRITE_NEXT, data)
      Severity: Major
      Found in pyBDM/bdm.py and 5 other locations - About 55 mins to fix
      pyBDM/bdm.py on lines 264..268
      pyBDM/bdm.py on lines 270..274
      pyBDM/bdm.py on lines 276..280
      pyBDM/bdm.py on lines 282..286
      pyBDM/bdm.py on lines 288..292

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

          def writeY(self, data):
              """ ..  py:method::
              """
              self.logger.debug("WRITE_Y[0x{0:04x}]".format(data))
              self.writeWord(WRITE_Y, data)
      Severity: Major
      Found in pyBDM/bdm.py and 5 other locations - About 55 mins to fix
      pyBDM/bdm.py on lines 228..232
      pyBDM/bdm.py on lines 264..268
      pyBDM/bdm.py on lines 270..274
      pyBDM/bdm.py on lines 276..280
      pyBDM/bdm.py on lines 288..292

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

          def writeD(self, data):
              """ ..  py:method::
              """
              self.logger.debug("WRITE_D[0x{0:04x}]".format(data))
              self.writeWord(WRITE_D, data)
      Severity: Major
      Found in pyBDM/bdm.py and 5 other locations - About 55 mins to fix
      pyBDM/bdm.py on lines 228..232
      pyBDM/bdm.py on lines 264..268
      pyBDM/bdm.py on lines 276..280
      pyBDM/bdm.py on lines 282..286
      pyBDM/bdm.py on lines 288..292

      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

      There are no issues that match your filters.

      Category
      Status