kontron/python-ipmi

View on GitHub
pyipmi/msgs/sensor.py

Summary

Maintainability
F
4 days
Test Coverage

File sensor.py has 261 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright (c) 2014  Kontron Europe GmbH
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
Severity: Minor
Found in pyipmi/msgs/sensor.py - About 2 hrs to fix

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

            Bitfield('readable_mask', 1,
                     Bitfield.Bit('lnc', 1, default=0),
                     Bitfield.Bit('lcr', 1, default=0),
                     Bitfield.Bit('lnr', 1, default=0),
                     Bitfield.Bit('unc', 1, default=0),
    Severity: Major
    Found in pyipmi/msgs/sensor.py and 1 other location - About 5 hrs to fix
    pyipmi/msgs/sensor.py on lines 175..182

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

    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

            Bitfield('set_mask', 1,
                     Bitfield.Bit('lnc', 1, default=0),
                     Bitfield.Bit('lcr', 1, default=0),
                     Bitfield.Bit('lnr', 1, default=0),
                     Bitfield.Bit('unc', 1, default=0),
    Severity: Major
    Found in pyipmi/msgs/sensor.py and 1 other location - About 5 hrs to fix
    pyipmi/msgs/sensor.py on lines 109..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 86.

    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

            Bitfield('threshold', 6,
                     Bitfield.Bit('lnc', 8, default=0),
                     Bitfield.Bit('lcr', 8, default=0),
                     Bitfield.Bit('lnr', 8, default=0),
                     Bitfield.Bit('unc', 8, default=0),
    Severity: Major
    Found in pyipmi/msgs/sensor.py and 1 other location - About 4 hrs to fix
    pyipmi/msgs/sensor.py on lines 183..189

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

    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

            Bitfield('threshold', 6,
                     Bitfield.Bit('lnc', 8, default=0),
                     Bitfield.Bit('lcr', 8, default=0),
                     Bitfield.Bit('lnr', 8, default=0),
                     Bitfield.Bit('unc', 8, default=0),
    Severity: Major
    Found in pyipmi/msgs/sensor.py and 1 other location - About 4 hrs to fix
    pyipmi/msgs/sensor.py on lines 117..123

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

    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

    @register_message_class
    class GetSensorHysteresisRsp(Message):
        __cmdid__ = constants.CMDID_GET_SENSOR_HYSTERESIS
        __netfn__ = constants.NETFN_SENSOR_EVENT | 1
        __fields__ = (
    Severity: Major
    Found in pyipmi/msgs/sensor.py and 1 other location - About 1 hr to fix
    pyipmi/msgs/chassis.py on lines 130..137

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

    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

    @register_message_class
    class GetDeviceSdrRsp(Message):
        __cmdid__ = constants.CMDID_GET_DEVICE_SDR
        __netfn__ = constants.NETFN_SENSOR_EVENT | 1
        __fields__ = (
    Severity: Major
    Found in pyipmi/msgs/sensor.py and 2 other locations - About 1 hr to fix
    pyipmi/msgs/sdr.py on lines 104..112
    pyipmi/msgs/sel.py on lines 103..110

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

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

    @register_message_class
    class ReserveDeviceSdrRepositoryRsp(Message):
        __cmdid__ = constants.CMDID_RESERVE_DEVICE_SDR_REPOSITORY
        __netfn__ = constants.NETFN_SENSOR_EVENT | 1
        __fields__ = (
    Severity: Major
    Found in pyipmi/msgs/sensor.py and 9 other locations - About 1 hr to fix
    pyipmi/msgs/bmc.py on lines 179..185
    pyipmi/msgs/fru.py on lines 87..93
    pyipmi/msgs/sdr.py on lines 82..88
    pyipmi/msgs/sdr.py on lines 125..131
    pyipmi/msgs/sdr.py on lines 150..156
    pyipmi/msgs/sdr.py on lines 170..176
    pyipmi/msgs/sel.py on lines 81..87
    pyipmi/msgs/sel.py on lines 123..129
    pyipmi/msgs/sel.py on lines 143..149

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

    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

                Bitfield('enable', 1,
                         Bitfield.ReservedBit(4, 0),
                         Bitfield.Bit('config', 2, 0),
                         Bitfield.Bit('sensor_scanning', 1, 0),
                         Bitfield.Bit('event_message', 1, 0),),
    Severity: Major
    Found in pyipmi/msgs/sensor.py and 1 other location - About 1 hr to fix
    pyipmi/msgs/sensor.py on lines 294..298

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

    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

                Bitfield('config', 1,
                         Bitfield.ReservedBit(5, 0),
                         Bitfield.Bit('initial_update_in_progress', 1, 0),
                         Bitfield.Bit('sensor_scanning_disabled', 1, 0),
                         Bitfield.Bit('event_message_disabled', 1, 0),),
    Severity: Major
    Found in pyipmi/msgs/sensor.py and 1 other location - About 1 hr to fix
    pyipmi/msgs/sensor.py on lines 208..212

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

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

    @register_message_class
    class RearmSensorEventsRsp(Message):
        __cmdid__ = constants.CMDID_RE_ARM_SENSOR
        __netfn__ = constants.NETFN_SENSOR_EVENT | 1
        __fields__ = (
    Severity: Major
    Found in pyipmi/msgs/sensor.py and 17 other locations - About 45 mins to fix
    pyipmi/msgs/bmc.py on lines 76..81
    pyipmi/msgs/bmc.py on lines 91..96
    pyipmi/msgs/bmc.py on lines 195..200
    pyipmi/msgs/bmc.py on lines 225..230
    pyipmi/msgs/chassis.py on lines 115..120
    pyipmi/msgs/chassis.py on lines 182..187
    pyipmi/msgs/device_messaging.py on lines 44..49
    pyipmi/msgs/device_messaging.py on lines 94..99
    pyipmi/msgs/device_messaging.py on lines 375..380
    pyipmi/msgs/device_messaging.py on lines 396..401
    pyipmi/msgs/device_messaging.py on lines 442..447
    pyipmi/msgs/device_messaging.py on lines 512..517
    pyipmi/msgs/event.py on lines 37..42
    pyipmi/msgs/sensor.py on lines 139..144
    pyipmi/msgs/sensor.py on lines 193..198
    pyipmi/msgs/sensor.py on lines 220..225
    pyipmi/msgs/sensor.py on lines 319..324

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

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

    @register_message_class
    class SetSensorHysteresisRsp(Message):
        __cmdid__ = constants.CMDID_SET_SENSOR_HYSTERESIS
        __netfn__ = constants.NETFN_SENSOR_EVENT | 1
        __fields__ = (
    Severity: Major
    Found in pyipmi/msgs/sensor.py and 17 other locations - About 45 mins to fix
    pyipmi/msgs/bmc.py on lines 76..81
    pyipmi/msgs/bmc.py on lines 91..96
    pyipmi/msgs/bmc.py on lines 195..200
    pyipmi/msgs/bmc.py on lines 225..230
    pyipmi/msgs/chassis.py on lines 115..120
    pyipmi/msgs/chassis.py on lines 182..187
    pyipmi/msgs/device_messaging.py on lines 44..49
    pyipmi/msgs/device_messaging.py on lines 94..99
    pyipmi/msgs/device_messaging.py on lines 375..380
    pyipmi/msgs/device_messaging.py on lines 396..401
    pyipmi/msgs/device_messaging.py on lines 442..447
    pyipmi/msgs/device_messaging.py on lines 512..517
    pyipmi/msgs/event.py on lines 37..42
    pyipmi/msgs/sensor.py on lines 193..198
    pyipmi/msgs/sensor.py on lines 220..225
    pyipmi/msgs/sensor.py on lines 269..274
    pyipmi/msgs/sensor.py on lines 319..324

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

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

    @register_message_class
    class SetSensorEventEnableRsp(Message):
        __cmdid__ = constants.CMDID_SET_SENSOR_EVENT_ENABLE
        __netfn__ = constants.NETFN_SENSOR_EVENT | 1
        __fields__ = (
    Severity: Major
    Found in pyipmi/msgs/sensor.py and 17 other locations - About 45 mins to fix
    pyipmi/msgs/bmc.py on lines 76..81
    pyipmi/msgs/bmc.py on lines 91..96
    pyipmi/msgs/bmc.py on lines 195..200
    pyipmi/msgs/bmc.py on lines 225..230
    pyipmi/msgs/chassis.py on lines 115..120
    pyipmi/msgs/chassis.py on lines 182..187
    pyipmi/msgs/device_messaging.py on lines 44..49
    pyipmi/msgs/device_messaging.py on lines 94..99
    pyipmi/msgs/device_messaging.py on lines 375..380
    pyipmi/msgs/device_messaging.py on lines 396..401
    pyipmi/msgs/device_messaging.py on lines 442..447
    pyipmi/msgs/device_messaging.py on lines 512..517
    pyipmi/msgs/event.py on lines 37..42
    pyipmi/msgs/sensor.py on lines 139..144
    pyipmi/msgs/sensor.py on lines 193..198
    pyipmi/msgs/sensor.py on lines 269..274
    pyipmi/msgs/sensor.py on lines 319..324

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

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

    @register_message_class
    class SetSensorThresholdsRsp(Message):
        __cmdid__ = constants.CMDID_SET_SENSOR_THRESHOLD
        __netfn__ = constants.NETFN_SENSOR_EVENT | 1
        __fields__ = (
    Severity: Major
    Found in pyipmi/msgs/sensor.py and 17 other locations - About 45 mins to fix
    pyipmi/msgs/bmc.py on lines 76..81
    pyipmi/msgs/bmc.py on lines 91..96
    pyipmi/msgs/bmc.py on lines 195..200
    pyipmi/msgs/bmc.py on lines 225..230
    pyipmi/msgs/chassis.py on lines 115..120
    pyipmi/msgs/chassis.py on lines 182..187
    pyipmi/msgs/device_messaging.py on lines 44..49
    pyipmi/msgs/device_messaging.py on lines 94..99
    pyipmi/msgs/device_messaging.py on lines 375..380
    pyipmi/msgs/device_messaging.py on lines 396..401
    pyipmi/msgs/device_messaging.py on lines 442..447
    pyipmi/msgs/device_messaging.py on lines 512..517
    pyipmi/msgs/event.py on lines 37..42
    pyipmi/msgs/sensor.py on lines 139..144
    pyipmi/msgs/sensor.py on lines 220..225
    pyipmi/msgs/sensor.py on lines 269..274
    pyipmi/msgs/sensor.py on lines 319..324

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

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

    @register_message_class
    class PlatformEventRsp(Message):
        __cmdid__ = constants.CMDID_PLATFORM_EVENT
        __netfn__ = constants.NETFN_SENSOR_EVENT | 1
        __fields__ = (
    Severity: Major
    Found in pyipmi/msgs/sensor.py and 17 other locations - About 45 mins to fix
    pyipmi/msgs/bmc.py on lines 76..81
    pyipmi/msgs/bmc.py on lines 91..96
    pyipmi/msgs/bmc.py on lines 195..200
    pyipmi/msgs/bmc.py on lines 225..230
    pyipmi/msgs/chassis.py on lines 115..120
    pyipmi/msgs/chassis.py on lines 182..187
    pyipmi/msgs/device_messaging.py on lines 44..49
    pyipmi/msgs/device_messaging.py on lines 94..99
    pyipmi/msgs/device_messaging.py on lines 375..380
    pyipmi/msgs/device_messaging.py on lines 396..401
    pyipmi/msgs/device_messaging.py on lines 442..447
    pyipmi/msgs/device_messaging.py on lines 512..517
    pyipmi/msgs/event.py on lines 37..42
    pyipmi/msgs/sensor.py on lines 139..144
    pyipmi/msgs/sensor.py on lines 193..198
    pyipmi/msgs/sensor.py on lines 220..225
    pyipmi/msgs/sensor.py on lines 269..274

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

    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 203..208
    pyipmi/msgs/sensor.py on lines 94..99
    pyipmi/msgs/sensor.py on lines 229..234

    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 GetSensorThresholdsReq(Message):
        __cmdid__ = constants.CMDID_GET_SENSOR_THRESHOLD
        __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 203..208
    pyipmi/msgs/sensor.py on lines 229..234
    pyipmi/msgs/sensor.py on lines 278..283

    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 203..208
    pyipmi/msgs/sensor.py on lines 94..99
    pyipmi/msgs/sensor.py on lines 278..283

    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