kontron/python-ipmi

View on GitHub
pyipmi/msgs/sensor.py

Summary

Maintainability
F
4 days
Test Coverage

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

from __future__ import absolute_import
# 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
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('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 110..117

    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('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 176..183

    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 118..124

    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 184..190

    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 131..138

    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 105..113
    pyipmi/msgs/sel.py on lines 104..111

    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 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 295..299

    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 9 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 8 other locations - About 1 hr to fix
    pyipmi/msgs/fru.py on lines 88..94
    pyipmi/msgs/sdr.py on lines 83..89
    pyipmi/msgs/sdr.py on lines 126..132
    pyipmi/msgs/sdr.py on lines 151..157
    pyipmi/msgs/sdr.py on lines 171..177
    pyipmi/msgs/sel.py on lines 82..88
    pyipmi/msgs/sel.py on lines 124..130
    pyipmi/msgs/sel.py on lines 144..150

    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 209..213

    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 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 79..84
    pyipmi/msgs/bmc.py on lines 94..99
    pyipmi/msgs/bmc.py on lines 196..201
    pyipmi/msgs/bmc.py on lines 226..231
    pyipmi/msgs/chassis.py on lines 116..121
    pyipmi/msgs/chassis.py on lines 183..188
    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 38..43
    pyipmi/msgs/sensor.py on lines 140..145
    pyipmi/msgs/sensor.py on lines 194..199
    pyipmi/msgs/sensor.py on lines 270..275
    pyipmi/msgs/sensor.py on lines 320..325

    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 79..84
    pyipmi/msgs/bmc.py on lines 94..99
    pyipmi/msgs/bmc.py on lines 196..201
    pyipmi/msgs/bmc.py on lines 226..231
    pyipmi/msgs/chassis.py on lines 116..121
    pyipmi/msgs/chassis.py on lines 183..188
    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 38..43
    pyipmi/msgs/sensor.py on lines 194..199
    pyipmi/msgs/sensor.py on lines 221..226
    pyipmi/msgs/sensor.py on lines 270..275
    pyipmi/msgs/sensor.py on lines 320..325

    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 79..84
    pyipmi/msgs/bmc.py on lines 94..99
    pyipmi/msgs/bmc.py on lines 196..201
    pyipmi/msgs/bmc.py on lines 226..231
    pyipmi/msgs/chassis.py on lines 116..121
    pyipmi/msgs/chassis.py on lines 183..188
    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 38..43
    pyipmi/msgs/sensor.py on lines 140..145
    pyipmi/msgs/sensor.py on lines 194..199
    pyipmi/msgs/sensor.py on lines 221..226
    pyipmi/msgs/sensor.py on lines 270..275

    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 79..84
    pyipmi/msgs/bmc.py on lines 94..99
    pyipmi/msgs/bmc.py on lines 196..201
    pyipmi/msgs/bmc.py on lines 226..231
    pyipmi/msgs/chassis.py on lines 116..121
    pyipmi/msgs/chassis.py on lines 183..188
    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 38..43
    pyipmi/msgs/sensor.py on lines 140..145
    pyipmi/msgs/sensor.py on lines 221..226
    pyipmi/msgs/sensor.py on lines 270..275
    pyipmi/msgs/sensor.py on lines 320..325

    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 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 79..84
    pyipmi/msgs/bmc.py on lines 94..99
    pyipmi/msgs/bmc.py on lines 196..201
    pyipmi/msgs/bmc.py on lines 226..231
    pyipmi/msgs/chassis.py on lines 116..121
    pyipmi/msgs/chassis.py on lines 183..188
    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 38..43
    pyipmi/msgs/sensor.py on lines 140..145
    pyipmi/msgs/sensor.py on lines 194..199
    pyipmi/msgs/sensor.py on lines 221..226
    pyipmi/msgs/sensor.py on lines 320..325

    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 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 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 204..209
    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 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

    There are no issues that match your filters.

    Category
    Status