mar10/fancytree

View on GitHub
src/jquery.fancytree.ariagrid.js

Summary

Maintainability
F
5 days
Test Coverage

File jquery.fancytree.ariagrid.js has 543 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jquery.fancytree.ariagrid.js
 *
 * Support ARIA compliant markup and keyboard navigation for tree grids with
 * embedded input controls.
Severity: Major
Found in src/jquery.fancytree.ariagrid.js - About 1 day to fix

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

            nodeKeydown: function (ctx) {
                var handleKeys,
                    inputType,
                    res,
                    $td,
    Severity: Major
    Found in src/jquery.fancytree.ariagrid.js - About 5 hrs to fix

      Function activateCell has 84 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          $.ui.fancytree._FancytreeClass.prototype.activateCell = function (
              $td,
              orgEvent
          ) {
              var colIdx,
      Severity: Major
      Found in src/jquery.fancytree.ariagrid.js - About 3 hrs to fix

        Function treeInit has 74 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                treeInit: function (ctx) {
                    var tree = ctx.tree,
                        treeOpts = ctx.options,
                        opts = treeOpts.ariagrid;
        
        
        Severity: Major
        Found in src/jquery.fancytree.ariagrid.js - About 2 hrs to fix

          Function findNeighbourTd has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function findNeighbourTd(tree, $target, keyCode) {
                  var nextNode,
                      node,
                      navMap = { "ctrl+home": "first", "ctrl+end": "last" },
                      $td = $target.closest("td"),
          Severity: Minor
          Found in src/jquery.fancytree.ariagrid.js - About 1 hr to fix

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

                    nodeClick: function (ctx) {
                        var targetType = ctx.targetType,
                            tree = ctx.tree,
                            node = ctx.node,
                            event = ctx.originalEvent,
            Severity: Minor
            Found in src/jquery.fancytree.ariagrid.js - About 1 hr to fix

              Avoid too many return statements within this function.
              Open

                                      return false;
              Severity: Major
              Found in src/jquery.fancytree.ariagrid.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                        return false;
                Severity: Major
                Found in src/jquery.fancytree.ariagrid.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                          return false;
                  Severity: Major
                  Found in src/jquery.fancytree.ariagrid.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                        return false; // no default handling
                    Severity: Major
                    Found in src/jquery.fancytree.ariagrid.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                              return false; // no default handling
                      Severity: Major
                      Found in src/jquery.fancytree.ariagrid.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                                return false;
                        Severity: Major
                        Found in src/jquery.fancytree.ariagrid.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                      return this._superApply(arguments);
                          Severity: Major
                          Found in src/jquery.fancytree.ariagrid.js - About 30 mins to fix

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

                                function findTdAtColIdx($tr, colIdx) {
                                    var colspan,
                                        res = null,
                                        idx = 0;
                            
                            
                            Severity: Major
                            Found in src/jquery.fancytree.ariagrid.js and 1 other location - About 3 hrs to fix
                            src/jquery.fancytree.gridnav.js on lines 70..84

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

                            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

                            (function (factory) {
                                if (typeof define === "function" && define.amd) {
                                    // AMD. Register as an anonymous module.
                                    define([
                                        "jquery",
                            Severity: Major
                            Found in src/jquery.fancytree.ariagrid.js and 2 other locations - About 3 hrs to fix
                            src/jquery.fancytree.fixed.js on lines 18..674
                            src/jquery.fancytree.gridnav.js on lines 16..220

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

                            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

                                function getColIdx($tr, $td) {
                                    var colspan,
                                        td = $td.get(0),
                                        idx = 0;
                            
                            
                            Severity: Major
                            Found in src/jquery.fancytree.ariagrid.js and 1 other location - About 3 hrs to fix
                            src/jquery.fancytree.gridnav.js on lines 54..67

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

                            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

                                        case "end":
                                            $tdNext = treeOpts.rtl
                                                ? $tr.children("td").first()
                                                : $tr.children("td").last();
                                            break;
                            Severity: Minor
                            Found in src/jquery.fancytree.ariagrid.js and 1 other location - About 50 mins to fix
                            src/jquery.fancytree.ariagrid.js on lines 134..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 52.

                            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

                                        case "home":
                                            $tdNext = treeOpts.rtl
                                                ? $tr.children("td").last()
                                                : $tr.children("td").first();
                                            break;
                            Severity: Minor
                            Found in src/jquery.fancytree.ariagrid.js and 1 other location - About 50 mins to fix
                            src/jquery.fancytree.ariagrid.js on lines 139..143

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

                            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