isikyus/aeldardin-rooms

View on GitHub
text_renderer.js

Summary

Maintainability
B
4 hrs
Test Coverage

Function addListeners has 90 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  var addListeners = function(container, store) {
    var $container = $(container);

    $container.on('click', '.js-select-checkbox', function(event) {
      var $checkbox = $(this),
Severity: Major
Found in text_renderer.js - About 3 hrs to fix

    Function has a complexity of 10.
    Open

        $container.on('change', '#js-add_door_form select', function(_event) {
    Severity: Minor
    Found in text_renderer.js by eslint

    Limit Cyclomatic Complexity (complexity)

    Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

    function a(x) {
        if (true) {
            return x; // 1st path
        } else if (false) {
            return x+1; // 2nd path
        } else {
            return 4; // 3rd path
        }
    }

    Rule Details

    This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

    Examples of incorrect code for a maximum of 2:

    /*eslint complexity: ["error", 2]*/
    
    function a(x) {
        if (true) {
            return x;
        } else if (false) {
            return x+1;
        } else {
            return 4; // 3rd path
        }
    }

    Examples of correct code for a maximum of 2:

    /*eslint complexity: ["error", 2]*/
    
    function a(x) {
        if (true) {
            return x;
        } else {
            return 4;
        }
    }

    Options

    Optionally, you may specify a max object property:

    "complexity": ["error", 2]

    is equivalent to

    "complexity": ["error", { "max": 2 }]

    Deprecated: the object property maximum is deprecated. Please use the property max instead.

    When Not To Use It

    If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

    Further Reading

    Related Rules

    • [max-depth](max-depth.md)
    • [max-len](max-len.md)
    • [max-nested-callbacks](max-nested-callbacks.md)
    • [max-params](max-params.md)
    • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

    Function renderAddDoor has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      var renderAddDoor = function(pendingState, container) {
        var $container = $(container),
            doorDetails = pendingState.action.payload,
            map = pendingState.state;
    
    
    Severity: Minor
    Found in text_renderer.js - About 1 hr to fix

      TODO found
      Open

                    // TODO: it would be nice to have more readable options, and pick the most suitable one.
      Severity: Minor
      Found in text_renderer.js by fixme

      TODO found
      Open

              // TODO: need separate tests for these calculations.
      Severity: Minor
      Found in text_renderer.js by fixme

      TODO found
      Open

                  // TODO: probably better to only include the room ID;
      Severity: Minor
      Found in text_renderer.js by fixme

      There are no issues that match your filters.

      Category
      Status