mar10/fancytree

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

Summary

Maintainability
F
6 days
Test Coverage

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

/*!
 * jquery.fancytree.fixed.js
 *
 * Add fixed colums and headers to ext.table.
 * (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/)
Severity: Major
Found in src/jquery.fancytree.fixed.js - About 1 day to fix

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

            treeInit: function (ctx) {
                this._requireExtension("table", true, true);
                // 'fixed' requires the table extension to be loaded before itself
    
                var res = this._superApply(arguments),
    Severity: Major
    Found in src/jquery.fancytree.fixed.js - About 7 hrs to fix

      Function nodeSetExpanded has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              nodeSetExpanded: function (ctx, flag, callOpts) {
                  var res,
                      self = this,
                      node = ctx.node,
                      $leftTr = $(node.tr),
      Severity: Minor
      Found in src/jquery.fancytree.fixed.js - About 1 hr to fix

        Function nodeRender has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                nodeRender: function (ctx, force, deep, collapsed, _recursive) {
                    var res = this._superApply(arguments),
                        node = ctx.node,
                        isRootNode = !node.parent;
        
        
        Severity: Minor
        Found in src/jquery.fancytree.fixed.js - About 1 hr to fix

          Function _adjustColWidths has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  _adjustColWidths: function () {
                      if (this.options.fixed.adjustColWidths) {
                          this.options.fixed.adjustColWidths.call(this);
                          return;
                      }
          Severity: Minor
          Found in src/jquery.fancytree.fixed.js - About 1 hr to fix

            Function _adjustWrapperLayout has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    _adjustWrapperLayout: function () {
                        var $wrapper = this.$fixedWrapper,
                            fcn = this.options.fixed.classNames,
                            $topLeftWrapper = $wrapper.find("div." + fcn.topLeft),
                            $topRightWrapper = $wrapper.find("div." + fcn.topRight),
            Severity: Minor
            Found in src/jquery.fancytree.fixed.js - About 1 hr to fix

              Function nodeRender has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      nodeRender: function (ctx, force, deep, collapsed, _recursive) {
              Severity: Minor
              Found in src/jquery.fancytree.fixed.js - About 35 mins to fix

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

                                try {
                                    tree.phase = "userEvent";
                                    switch (evt.type) {
                                        case "click":
                                            ctx.targetType = et.type;
                Severity: Major
                Found in src/jquery.fancytree.fixed.js and 1 other location - About 6 hrs to fix
                src/jquery.fancytree.js on lines 6669..6702

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

                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

                        treeDestroy: function (ctx) {
                            var tree = ctx.tree,
                                $table = tree.widget.element,
                                $wrapper = this.$fixedWrapper,
                                fcn = this.options.fixed.classNames;
                Severity: Major
                Found in src/jquery.fancytree.fixed.js and 1 other location - About 4 hrs to fix
                src/jquery.fancytree.fixed.js on lines 500..512

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

                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

                        treeClear: function (ctx) {
                            var tree = ctx.tree,
                                $table = tree.widget.element,
                                $wrapper = this.$fixedWrapper,
                                fcn = this.options.fixed.classNames;
                Severity: Major
                Found in src/jquery.fancytree.fixed.js and 1 other location - About 4 hrs to fix
                src/jquery.fancytree.fixed.js on lines 518..530

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

                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 $wrapper = this.$fixedWrapper,
                                fcn = this.options.fixed.classNames,
                                $tlWrapper = $wrapper.find("div." + fcn.topLeft),
                                $blWrapper = $wrapper.find("div." + fcn.bottomLeft),
                                $trWrapper = $wrapper.find("div." + fcn.topRight),
                Severity: Major
                Found in src/jquery.fancytree.fixed.js and 1 other location - About 3 hrs to fix
                src/jquery.fancytree.fixed.js on lines 283..288

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

                            var $wrapper = this.$fixedWrapper,
                                fcn = this.options.fixed.classNames,
                                $topLeftWrapper = $wrapper.find("div." + fcn.topLeft),
                                $topRightWrapper = $wrapper.find("div." + fcn.topRight),
                                $bottomLeftWrapper = $wrapper.find("div." + fcn.bottomLeft),
                Severity: Major
                Found in src/jquery.fancytree.fixed.js and 1 other location - About 3 hrs to fix
                src/jquery.fancytree.fixed.js on lines 538..543

                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.fixed.js and 2 other locations - About 3 hrs to fix
                src/jquery.fancytree.ariagrid.js on lines 19..714
                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

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

                            $tableWrapper
                                .on(
                                    "mouseenter",
                                    "." +
                                        fcn.bottomRight +
                Severity: Major
                Found in src/jquery.fancytree.fixed.js and 1 other location - About 2 hrs to fix
                src/jquery.fancytree.fixed.js on lines 189..217

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

                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