kontron/python-ipmi

View on GitHub

Showing 341 of 341 total issues

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

File fru.py has 351 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/fru.py - About 4 hrs to fix

    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

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

            Bitfield('alarm_capabilities', 1,
                     Bitfield.Bit('critical_alarm', 1, 0),
                     Bitfield.Bit('major_alarm', 1, 0),
                     Bitfield.Bit('minor_alarm', 1, 0),
                     Bitfield.Bit('power_alarm', 1, 0),
    Severity: Major
    Found in pyipmi/msgs/picmg.py and 1 other location - About 4 hrs to fix
    pyipmi/msgs/bmc.py on lines 136..144

    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

            Bitfield('status', 1,
                     Bitfield.Bit('controller_firmware_corrupted', 1, 0),
                     Bitfield.Bit('controller_bootblock_corrupted', 1, 0),
                     Bitfield.Bit('internal_use_area_corrupted', 1, 0),
                     Bitfield.Bit('sdr_repository_empty', 1, 0),
    Severity: Major
    Found in pyipmi/msgs/bmc.py and 1 other location - About 4 hrs to fix
    pyipmi/msgs/picmg.py on lines 790..798

    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('enables', 1,
                     Bitfield.Bit('receive_message_queue_interrupt', 1, 0),
                     Bitfield.Bit('event_message_buffer_full_interrupt', 1, 0),
                     Bitfield.Bit('event_message_buffer', 1, 0),
                     Bitfield.Bit('system_event_logging', 1, 0),
    Severity: Major
    Found in pyipmi/msgs/device_messaging.py and 1 other location - About 4 hrs to fix
    pyipmi/msgs/device_messaging.py on lines 65..73

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

    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('enables', 1,
                     Bitfield.Bit('receive_message_queue_interrupt', 1, 0),
                     Bitfield.Bit('event_message_buffer_full_interrupt', 1, 0),
                     Bitfield.Bit('event_message_buffer', 1, 0),
                     Bitfield.Bit('system_event_logging', 1, 0),
    Severity: Major
    Found in pyipmi/msgs/device_messaging.py and 1 other location - About 4 hrs to fix
    pyipmi/msgs/device_messaging.py on lines 32..40

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

    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

    Hpm has 33 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Hpm(object):
    
        @staticmethod
        def _get_component_count(components):
            """Return the number of components."""
    Severity: Minor
    Found in pyipmi/hpm.py - About 4 hrs to fix

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

              Bitfield('clear', 1,
                       Bitfield.Bit('receive_message_queue', 1, 0),
                       Bitfield.Bit('event_message_buffer', 1, 0),
                       Bitfield.ReservedBit(1, 0),
                       Bitfield.Bit('watchdog_pretimeout_interrupt_flag', 1, 0),
      Severity: Major
      Found in pyipmi/msgs/device_messaging.py and 1 other location - About 4 hrs to fix
      pyipmi/msgs/device_messaging.py on lines 115..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 76.

      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('flag', 1,
                       Bitfield.Bit('receive_message_available', 1, 0),
                       Bitfield.Bit('event_message_buffer_full', 1, 0),
                       Bitfield.ReservedBit(1, 0),
                       Bitfield.Bit('watchdog_pretimeout_interrupt_occurred', 1, 0),
      Severity: Major
      Found in pyipmi/msgs/device_messaging.py and 1 other location - About 4 hrs to fix
      pyipmi/msgs/device_messaging.py on lines 82..90

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

      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

              while retries < self.max_retries:
                  try:
                      self._send_raw(header, payload)
                      rx_data = self._receive_raw(header)
                      break
      Severity: Major
      Found in pyipmi/interfaces/aardvark.py and 1 other location - About 4 hrs to fix
      pyipmi/interfaces/ipmbdev.py on lines 118..132

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

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

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

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

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

      Refactorings

      Further Reading

      Function cmd_fru_print has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

      def cmd_fru_print(ipmi, args):
          fru_id = 0
          print_all = False
          if len(args) > 0:
              fru_id = int(args[0])
      Severity: Minor
      Found in pyipmi/ipmitool.py - About 4 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

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

              while retries < self.max_retries:
                  try:
                      self._send_raw(header, payload)
                      rx_data = self._receive_raw(header)
                      break
      Severity: Major
      Found in pyipmi/interfaces/ipmbdev.py and 1 other location - About 4 hrs to fix
      pyipmi/interfaces/aardvark.py on lines 170..184

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

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

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

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

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

      Refactorings

      Further Reading

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

          def _get_device_sdr_chunk(self, reservation_id, record_id, offset, length):
              req = create_request_by_name('GetDeviceSdr')
              req.reservation_id = reservation_id
              req.record_id = record_id
              req.offset = offset
      Severity: Major
      Found in pyipmi/sensor.py and 1 other location - About 3 hrs to fix
      pyipmi/sdr.py on lines 75..85

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

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

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

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

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

      Refactorings

      Further Reading

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

          def _get_sdr_chunk(self, reservation_id, record_id, offset, length):
              req = create_request_by_name('GetSdr')
              req.reservation_id = reservation_id
              req.record_id = record_id
              req.offset = offset
      Severity: Major
      Found in pyipmi/sdr.py and 1 other location - About 3 hrs to fix
      pyipmi/sensor.py on lines 113..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 72.

      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

          if area:
              print('''
      Chassis Info Area:
        Type:               %(type)d
        Part Number:        %(part_number)s
      Severity: Major
      Found in pyipmi/ipmitool.py and 2 other locations - About 3 hrs to fix
      pyipmi/ipmitool.py on lines 243..257
      pyipmi/ipmitool.py on lines 261..276

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

      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

          if area:
              print('''
      Product Info Area:
        Manufacturer:       %(manufacturer)s
        Name:               %(name)s
      Severity: Major
      Found in pyipmi/ipmitool.py and 2 other locations - About 3 hrs to fix
      pyipmi/ipmitool.py on lines 228..239
      pyipmi/ipmitool.py on lines 243..257

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

      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

          if area:
              print('''
      Board Info Area:
        Mfg. Date / Time:   %(mfg_date)s
        Manufacturer:       %(manufacturer)s
      Severity: Major
      Found in pyipmi/ipmitool.py and 2 other locations - About 3 hrs to fix
      pyipmi/ipmitool.py on lines 228..239
      pyipmi/ipmitool.py on lines 261..276

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

      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('capabilities', 1,
                       Bitfield.Bit('firmware_upgrade_undesirable', 1),
                       Bitfield.Bit('automatic_rollback_overriden', 1),
                       Bitfield.Bit('ipmc_degraded_during_upgrade', 1),
                       Bitfield.Bit('deferred_activation', 1),
      Severity: Major
      Found in pyipmi/msgs/hpm.py and 1 other location - About 3 hrs to fix
      pyipmi/msgs/bmc.py on lines 58..66

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

      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