kontron/python-ipmi

View on GitHub

Showing 253 of 341 total issues

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

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 VitaGetChassisIdentifierReq(VitaMessage):
    __cmdid__ = constants.CMDID_VITA_GET_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 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 2 locations. Consider refactoring.
Open

    def decode(self, obj, data):
        value = data.pop_unsigned_int(self.length)
        setattr(obj, self.name, value)
Severity: Minor
Found in pyipmi/msgs/message.py and 1 other location - About 30 mins to fix
pyipmi/msgs/message.py on lines 117..119

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

@register_message_class
class RunInitializationAgentReq(Message):
    __cmdid__ = constants.CMDID_RUN_INITIALIZATION_AGENT
    __netfn__ = constants.NETFN_STORAGE
    __fields__ = (
Severity: Major
Found in pyipmi/msgs/sdr.py and 4 other locations - About 30 mins to fix
pyipmi/msgs/device_messaging.py on lines 366..371
pyipmi/msgs/sensor.py on lines 95..100
pyipmi/msgs/sensor.py on lines 230..235
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 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 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 5 locations. Consider refactoring.
Open

@register_message_class
class CloseSessionReq(Message):
    __cmdid__ = constants.CMDID_CLOSE_SESSION
    __netfn__ = constants.NETFN_APP
    __fields__ = (
Severity: Major
Found in pyipmi/msgs/device_messaging.py and 4 other locations - About 30 mins to fix
pyipmi/msgs/sdr.py on lines 204..209
pyipmi/msgs/sensor.py on lines 95..100
pyipmi/msgs/sensor.py on lines 230..235
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 AbortFirmwareUpgradeReq(PicmgMessage):
    __cmdid__ = constants.CMDID_HPM_ABORT_FIRMWARE_UPGRADE
    __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 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 2 locations. Consider refactoring.
Open

    def decode(self, obj, data):
        value = data.pop_string(self.length)
        setattr(obj, self.name, value)
Severity: Minor
Found in pyipmi/msgs/message.py and 1 other location - About 30 mins to fix
pyipmi/msgs/message.py on lines 101..103

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