kontron/python-ipmi

View on GitHub

Showing 341 of 341 total issues

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

    def send_message(self, req, retry=3):
        req.target = self.target
        req.requester = self.requester
        rsp = None

Severity: Minor
Found in pyipmi/__init__.py - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

    def get_power_level(self, fru_id, power_type):
        rsp = self.send_message_with_name('GetPowerLevel',
                                          fru_id=fru_id,
                                          power_type=power_type)
        return PowerLevel(rsp)
Severity: Minor
Found in pyipmi/picmg.py and 1 other location - About 35 mins to fix
pyipmi/picmg.py on lines 73..77

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

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

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

    def _from_response(self, rsp):
        self.device_id = rsp.device_id
        self.revision = rsp.device_revision.device_revision
        self.provides_sdrs = bool(rsp.device_revision.provides_device_sdrs)
        self.available = bool(rsp.firmware_revision.device_available)
Severity: Minor
Found in pyipmi/bmc.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

        log().debug('I2C TX to %02Xh [%s]', i2c_addr,
                    ' '.join(['%02x' % b for b in raw_bytes]))
Severity: Minor
Found in pyipmi/interfaces/ipmbdev.py and 1 other location - About 35 mins to fix
pyipmi/interfaces/aardvark.py on lines 115..116

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

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

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

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

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

Refactorings

Further Reading

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

        for function in functions:
            if hasattr(rsp.additional_support, function):
                if getattr(rsp.additional_support, function):
                    self.supported_functions.append(function)
Severity: Minor
Found in pyipmi/bmc.py and 1 other location - About 35 mins to fix
pyipmi/messaging.py on lines 157..160

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

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 get_led_state(self, fru_id, led_id):
        rsp = self.send_message_with_name('GetFruLedState',
                                          fru_id=fru_id,
                                          led_id=led_id)
        return LedState(rsp)
Severity: Minor
Found in pyipmi/picmg.py and 1 other location - About 35 mins to fix
pyipmi/picmg.py on lines 50..54

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

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

@register_message_class
class GetPicmgPropertiesReq(PicmgMessage):
    __cmdid__ = constants.CMDID_GET_PICMG_PROPERTIES
    __netfn__ = constants.NETFN_GROUP_EXTENSION
    __fields__ = (
Severity: Major
Found in pyipmi/msgs/picmg.py and 11 other locations - About 30 mins to fix
pyipmi/msgs/hpm.py on lines 29..34
pyipmi/msgs/hpm.py on lines 86..91
pyipmi/msgs/hpm.py on lines 170..175
pyipmi/msgs/hpm.py on lines 212..217
pyipmi/msgs/hpm.py on lines 233..238
pyipmi/msgs/hpm.py on lines 254..259
pyipmi/msgs/picmg.py on lines 164..169
pyipmi/msgs/vita.py on lines 42..47
pyipmi/msgs/vita.py on lines 77..82
pyipmi/msgs/vita.py on lines 128..133
pyipmi/msgs/vita.py on lines 147..152

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

@register_message_class
class GetUpgradeStatusReq(PicmgMessage):
    __cmdid__ = constants.CMDID_HPM_GET_UPGRADE_STATUS
    __netfn__ = constants.NETFN_GROUP_EXTENSION
    __fields__ = (
Severity: Major
Found in pyipmi/msgs/hpm.py and 11 other locations - About 30 mins to fix
pyipmi/msgs/hpm.py on lines 29..34
pyipmi/msgs/hpm.py on lines 86..91
pyipmi/msgs/hpm.py on lines 212..217
pyipmi/msgs/hpm.py on lines 233..238
pyipmi/msgs/hpm.py on lines 254..259
pyipmi/msgs/picmg.py on lines 107..112
pyipmi/msgs/picmg.py on lines 164..169
pyipmi/msgs/vita.py on lines 42..47
pyipmi/msgs/vita.py on lines 77..82
pyipmi/msgs/vita.py on lines 128..133
pyipmi/msgs/vita.py on lines 147..152

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

@register_message_class
class InitiateManualRollbackReq(PicmgMessage):
    __cmdid__ = constants.CMDID_HPM_INITIATE_MANUAL_ROLLBACK
    __netfn__ = constants.NETFN_GROUP_EXTENSION
    __fields__ = (
Severity: Major
Found in pyipmi/msgs/hpm.py and 11 other locations - About 30 mins to fix
pyipmi/msgs/hpm.py on lines 29..34
pyipmi/msgs/hpm.py on lines 86..91
pyipmi/msgs/hpm.py on lines 170..175
pyipmi/msgs/hpm.py on lines 212..217
pyipmi/msgs/hpm.py on lines 233..238
pyipmi/msgs/picmg.py on lines 107..112
pyipmi/msgs/picmg.py on lines 164..169
pyipmi/msgs/vita.py on lines 42..47
pyipmi/msgs/vita.py on lines 77..82
pyipmi/msgs/vita.py on lines 128..133
pyipmi/msgs/vita.py on lines 147..152

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

@register_message_class
class QueryRollbackStatusReq(PicmgMessage):
    __cmdid__ = constants.CMDID_HPM_QUERY_ROLLBACK_STATUS
    __netfn__ = constants.NETFN_GROUP_EXTENSION
    __fields__ = (
Severity: Major
Found in pyipmi/msgs/hpm.py and 11 other locations - About 30 mins to fix
pyipmi/msgs/hpm.py on lines 29..34
pyipmi/msgs/hpm.py on lines 86..91
pyipmi/msgs/hpm.py on lines 170..175
pyipmi/msgs/hpm.py on lines 212..217
pyipmi/msgs/hpm.py on lines 254..259
pyipmi/msgs/picmg.py on lines 107..112
pyipmi/msgs/picmg.py on lines 164..169
pyipmi/msgs/vita.py on lines 42..47
pyipmi/msgs/vita.py on lines 77..82
pyipmi/msgs/vita.py on lines 128..133
pyipmi/msgs/vita.py on lines 147..152

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

@register_message_class
class GetSensorEventEnableReq(Message):
    __cmdid__ = constants.CMDID_GET_SENSOR_EVENT_ENABLE
    __netfn__ = constants.NETFN_SENSOR_EVENT
    __fields__ = (
Severity: Major
Found in pyipmi/msgs/sensor.py and 4 other locations - About 30 mins to fix
pyipmi/msgs/device_messaging.py on lines 366..371
pyipmi/msgs/sdr.py on lines 204..209
pyipmi/msgs/sensor.py on lines 95..100
pyipmi/msgs/sensor.py on lines 279..284

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

@register_message_class
class VitaGetVsoCapabilitiesReq(VitaMessage):
    __cmdid__ = constants.CMDID_VITA_GET_VSO_CAPABILITIES
    __netfn__ = constants.NETFN_GROUP_EXTENSION
    __fields__ = (
Severity: Major
Found in pyipmi/msgs/vita.py and 11 other locations - About 30 mins to fix
pyipmi/msgs/hpm.py on lines 29..34
pyipmi/msgs/hpm.py on lines 86..91
pyipmi/msgs/hpm.py on lines 170..175
pyipmi/msgs/hpm.py on lines 212..217
pyipmi/msgs/hpm.py on lines 233..238
pyipmi/msgs/hpm.py on lines 254..259
pyipmi/msgs/picmg.py on lines 107..112
pyipmi/msgs/picmg.py on lines 164..169
pyipmi/msgs/vita.py on lines 77..82
pyipmi/msgs/vita.py on lines 128..133
pyipmi/msgs/vita.py on lines 147..152

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

@register_message_class
class VitaSetChassisIdentifierReq(VitaMessage):
    __cmdid__ = constants.CMDID_VITA_SET_CHASSIS_IDENTIFIER
    __netfn__ = constants.NETFN_GROUP_EXTENSION
    __fields__ = (
Severity: Major
Found in pyipmi/msgs/vita.py and 11 other locations - About 30 mins to fix
pyipmi/msgs/hpm.py on lines 29..34
pyipmi/msgs/hpm.py on lines 86..91
pyipmi/msgs/hpm.py on lines 170..175
pyipmi/msgs/hpm.py on lines 212..217
pyipmi/msgs/hpm.py on lines 233..238
pyipmi/msgs/hpm.py on lines 254..259
pyipmi/msgs/picmg.py on lines 107..112
pyipmi/msgs/picmg.py on lines 164..169
pyipmi/msgs/vita.py on lines 42..47
pyipmi/msgs/vita.py on lines 77..82
pyipmi/msgs/vita.py on lines 128..133

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

@register_message_class
class GetSensorReadingReq(Message):
    __cmdid__ = constants.CMDID_GET_SENSOR_READING
    __netfn__ = constants.NETFN_SENSOR_EVENT
    __fields__ = (
Severity: Major
Found in pyipmi/msgs/sensor.py and 4 other locations - About 30 mins to fix
pyipmi/msgs/device_messaging.py on lines 366..371
pyipmi/msgs/sdr.py on lines 204..209
pyipmi/msgs/sensor.py on lines 95..100
pyipmi/msgs/sensor.py on lines 230..235

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

@register_message_class
class QuerySelftestResultsReq(PicmgMessage):
    __cmdid__ = constants.CMDID_HPM_QUERY_SELFTEST_RESULTS
    __netfn__ = constants.NETFN_GROUP_EXTENSION
    __fields__ = (
Severity: Major
Found in pyipmi/msgs/hpm.py and 11 other locations - About 30 mins to fix
pyipmi/msgs/hpm.py on lines 29..34
pyipmi/msgs/hpm.py on lines 86..91
pyipmi/msgs/hpm.py on lines 170..175
pyipmi/msgs/hpm.py on lines 233..238
pyipmi/msgs/hpm.py on lines 254..259
pyipmi/msgs/picmg.py on lines 107..112
pyipmi/msgs/picmg.py on lines 164..169
pyipmi/msgs/vita.py on lines 42..47
pyipmi/msgs/vita.py on lines 77..82
pyipmi/msgs/vita.py on lines 128..133
pyipmi/msgs/vita.py on lines 147..152

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

    @staticmethod
    def _do_upgrade_action_prepare(image):
        for action in image.actions:
            if isinstance(action, UpgradeActionRecordPrepare):
                print("do ACTION_PREPARE_COMPONENT")
Severity: Minor
Found in pyipmi/hpm.py and 1 other location - About 30 mins to fix
pyipmi/hpm.py on lines 290..294

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

@register_message_class
class GetShelfAddressInfoReq(PicmgMessage):
    __cmdid__ = constants.CMDID_GET_SHELF_ADDRESS_INFO
    __netfn__ = constants.NETFN_GROUP_EXTENSION
    __fields__ = (
Severity: Major
Found in pyipmi/msgs/picmg.py and 11 other locations - About 30 mins to fix
pyipmi/msgs/hpm.py on lines 29..34
pyipmi/msgs/hpm.py on lines 86..91
pyipmi/msgs/hpm.py on lines 170..175
pyipmi/msgs/hpm.py on lines 212..217
pyipmi/msgs/hpm.py on lines 233..238
pyipmi/msgs/hpm.py on lines 254..259
pyipmi/msgs/picmg.py on lines 107..112
pyipmi/msgs/vita.py on lines 42..47
pyipmi/msgs/vita.py on lines 77..82
pyipmi/msgs/vita.py on lines 128..133
pyipmi/msgs/vita.py on lines 147..152

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

        Bitfield('userid', 1,
                 Bitfield.Bit('userid', 6, 0),
                 Bitfield.ReservedBit(1, 0),
                 Bitfield.Bit('password_size', 1, 0)),
Severity: Minor
Found in pyipmi/msgs/device_messaging.py and 2 other locations - About 30 mins to fix
pyipmi/msgs/device_messaging.py on lines 244..247
pyipmi/msgs/picmg.py on lines 403..406

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

@register_message_class
class GetTargetUpgradeCapabilitiesReq(PicmgMessage):
    __cmdid__ = constants.CMDID_HPM_GET_TARGET_UPGRADE_CAPABILITIES
    __netfn__ = constants.NETFN_GROUP_EXTENSION
    __fields__ = (
Severity: Major
Found in pyipmi/msgs/hpm.py and 11 other locations - About 30 mins to fix
pyipmi/msgs/hpm.py on lines 86..91
pyipmi/msgs/hpm.py on lines 170..175
pyipmi/msgs/hpm.py on lines 212..217
pyipmi/msgs/hpm.py on lines 233..238
pyipmi/msgs/hpm.py on lines 254..259
pyipmi/msgs/picmg.py on lines 107..112
pyipmi/msgs/picmg.py on lines 164..169
pyipmi/msgs/vita.py on lines 42..47
pyipmi/msgs/vita.py on lines 77..82
pyipmi/msgs/vita.py on lines 128..133
pyipmi/msgs/vita.py on lines 147..152

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

        Bitfield('channel', 1,
                 Bitfield.Bit('number', 4, 0),
                 Bitfield.ReservedBit(3, 0),
                 Bitfield.Bit('type', 1, 0),),
Severity: Minor
Found in pyipmi/msgs/device_messaging.py and 2 other locations - About 30 mins to fix
pyipmi/msgs/device_messaging.py on lines 431..434
pyipmi/msgs/picmg.py on lines 403..406

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

Severity
Category
Status
Source
Language