datahuborg/datahub

View on GitHub
src/apps/dbwipes/static/js/lib/shepherd.js

Summary

Maintainability
F
1 mo
Test Coverage

File shepherd.js has 476 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function() {
  var ATTACHMENT, Evented, Shepherd, Step, Tour, addClass, createFromHTML, extend, getBounds, hasClass, matchesSelector, parseShorthand, removeClass, uniqueId, _ref,
    __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
Severity: Minor
Found in src/apps/dbwipes/static/js/lib/shepherd.js - About 7 hrs to fix

    Function render has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        Step.prototype.render = function() {
          var button, buttons, cfg, content, footer, header, link, paragraph, paragraphs, text, _i, _j, _len, _len1, _ref1, _ref2, _ref3;
          if (this.el != null) {
            this.destroy();
          }
    Severity: Minor
    Found in src/apps/dbwipes/static/js/lib/shepherd.js - About 2 hrs to fix

      Function show has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          Step.prototype.show = function() {
            var _this = this;
            if (this.el == null) {
              this.render();
              if (this.options.style) {
      Severity: Minor
      Found in src/apps/dbwipes/static/js/lib/shepherd.js - About 1 hr to fix

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

            Step.prototype.bindButtonEvents = function(cfg, el) {
              var event, handler, page, _ref1,
                _this = this;
              if (cfg.events == null) {
                cfg.events = {};
        Severity: Minor
        Found in src/apps/dbwipes/static/js/lib/shepherd.js - About 1 hr to fix

          Function show has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              Tour.prototype.show = function(key) {
                var next;
                if (key == null) {
                  key = 0;
                }
          Severity: Minor
          Found in src/apps/dbwipes/static/js/lib/shepherd.js - About 1 hr to fix

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

            (function() {
              var ATTACHMENT, Evented, Shepherd, Step, Tour, addClass, createFromHTML, extend, getBounds, hasClass, matchesSelector, parseShorthand, removeClass, uniqueId, _ref,
                __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
                __hasProp = {}.hasOwnProperty,
                __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
            Severity: Major
            Found in src/apps/dbwipes/static/js/lib/shepherd.js and 1 other location - About 1 mo to fix
            src/browser/static/dbwipes/js/lib/shepherd.js on lines 1..523

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

            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