derwentx/js-pixelblaze-expander

View on GitHub

Showing 26 of 26 total issues

Function ExpanderDevice has 149 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var ExpanderDevice = /*#__PURE__*/function () {
  /**
   * Construct a PixelBlaxe Expander Device.
   *
   * @param {string} portName the name of the
Severity: Major
Found in src/device.js - About 5 hrs to fix

    Function ExpanderDevice has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

    var ExpanderDevice = /*#__PURE__*/function () {
      /**
       * Construct a PixelBlaxe Expander Device.
       *
       * @param {string} portName the name of the
    Severity: Minor
    Found in src/device.js - 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 5 locations. Consider refactoring.
    Open

    function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
    Severity: Major
    Found in src/colorOrder.js and 4 other locations - About 3 hrs to fix
    src/crc.js on lines 12..12
    src/device.js on lines 40..40
    src/header.js on lines 12..12
    src/messages.js on lines 35..35

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

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

    function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
    Severity: Major
    Found in src/crc.js and 4 other locations - About 3 hrs to fix
    src/colorOrder.js on lines 10..10
    src/device.js on lines 40..40
    src/header.js on lines 12..12
    src/messages.js on lines 35..35

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

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

    function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
    Severity: Major
    Found in src/header.js and 4 other locations - About 3 hrs to fix
    src/colorOrder.js on lines 10..10
    src/crc.js on lines 12..12
    src/device.js on lines 40..40
    src/messages.js on lines 35..35

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

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

    function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
    Severity: Major
    Found in src/device.js and 4 other locations - About 3 hrs to fix
    src/colorOrder.js on lines 10..10
    src/crc.js on lines 12..12
    src/header.js on lines 12..12
    src/messages.js on lines 35..35

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

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

    function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
    Severity: Major
    Found in src/messages.js and 4 other locations - About 3 hrs to fix
    src/colorOrder.js on lines 10..10
    src/crc.js on lines 12..12
    src/device.js on lines 40..40
    src/header.js on lines 12..12

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

    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 PBXMessage has 90 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var PBXMessage = /*#__PURE__*/function () {
      _createClass(PBXMessage, null, [{
        key: "baseSize",
        value: function baseSize(type) {
          switch (type) {
    Severity: Major
    Found in src/messages.js - About 3 hrs to fix

      Function PBXCrc has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var PBXCrc = /*#__PURE__*/function () {
        function PBXCrc() {
          _classCallCheck(this, PBXCrc);
      
          this.reset();
      Severity: Major
      Found in src/crc.js - About 2 hrs to fix

        Function ExpanderDevice has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function ExpanderDevice(portName, options) {
            var _this = this;
        
            _classCallCheck(this, ExpanderDevice);
        
        
        Severity: Minor
        Found in src/device.js - About 1 hr to fix

          Function PBXMessage has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

          var PBXMessage = /*#__PURE__*/function () {
            _createClass(PBXMessage, null, [{
              key: "baseSize",
              value: function baseSize(type) {
                switch (type) {
          Severity: Minor
          Found in src/messages.js - About 1 hr to fix

          Cognitive Complexity

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

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

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

          Further reading

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

          var PBAPA102DataMessage = /*#__PURE__*/function (_PBXDataMessage2) {
            _inherits(PBAPA102DataMessage, _PBXDataMessage2);
          
            var _super4 = _createSuper(PBAPA102DataMessage);
          
          
          Severity: Major
          Found in src/messages.js and 1 other location - About 1 hr to fix
          src/messages.js on lines 253..265

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

          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

          var PBAPA102ClockMessage = /*#__PURE__*/function (_PBXMessage3) {
            _inherits(PBAPA102ClockMessage, _PBXMessage3);
          
            var _super5 = _createSuper(PBAPA102ClockMessage);
          
          
          Severity: Major
          Found in src/messages.js and 1 other location - About 1 hr to fix
          src/messages.js on lines 237..249

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

          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 PBXDataMessage has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var PBXDataMessage = /*#__PURE__*/function (_PBXMessage2) {
            _inherits(PBXDataMessage, _PBXMessage2);
          
            var _super2 = _createSuper(PBXDataMessage);
          
          
          Severity: Minor
          Found in src/messages.js - About 1 hr to fix

            Function PBXHeader has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var PBXHeader = /*#__PURE__*/function () {
              function PBXHeader(channel, recordType) {
                _classCallCheck(this, PBXHeader);
            
                if (channel >= _constants.CHANNEL_MAX) {
            Severity: Minor
            Found in src/header.js - About 1 hr to fix

              Function PBColorOrder has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              var PBColorOrder = /*#__PURE__*/function () {
                function PBColorOrder() {
                  var _this = this;
              
                  _classCallCheck(this, PBColorOrder);
              Severity: Minor
              Found in src/colorOrder.js - About 1 hr to fix

                Function PBColorOrder has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                var PBColorOrder = /*#__PURE__*/function () {
                  function PBColorOrder() {
                    var _this = this;
                
                    _classCallCheck(this, PBColorOrder);
                Severity: Minor
                Found in src/colorOrder.js - About 1 hr 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

                Function PBXCrc has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                var PBXCrc = /*#__PURE__*/function () {
                  function PBXCrc() {
                    _classCallCheck(this, PBXCrc);
                
                    this.reset();
                Severity: Minor
                Found in src/crc.js - About 55 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

                Function PBXHeader has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                var PBXHeader = /*#__PURE__*/function () {
                  function PBXHeader(channel, recordType) {
                    _classCallCheck(this, PBXHeader);
                
                    if (channel >= _constants.CHANNEL_MAX) {
                Severity: Minor
                Found in src/header.js - About 45 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

                Function _typeof has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
                Severity: Minor
                Found in src/messages.js - About 45 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

                Severity
                Category
                Status
                Source
                Language