holderdeord/hdo-site

View on GitHub

Showing 302 of 302 total issues

Method import_promise has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

      def import_promise(promise)
        log_import promise

        unless promise.valid?
          @log.error "promise is not valid: #{promise.inspect}"
Severity: Minor
Found in lib/hdo/import/persister.rb - 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

    util.addEvent = function (elem, event, listener) {
        if (elem.attachEvent) {
            // IE only.  The "on" is mandatory.
            elem.attachEvent("on" + event, listener);
        }
Severity: Major
Found in app/assets/javascripts/lib/pagedown/Markdown.Editor.js and 1 other location - About 1 hr to fix
app/assets/javascripts/lib/pagedown/Markdown.Editor.js on lines 337..346

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

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

    util.removeEvent = function (elem, event, listener) {
        if (elem.detachEvent) {
            // IE only.  The "on" is mandatory.
            elem.detachEvent("on" + event, listener);
        }
Severity: Major
Found in app/assets/javascripts/lib/pagedown/Markdown.Editor.js and 1 other location - About 1 hr to fix
app/assets/javascripts/lib/pagedown/Markdown.Editor.js on lines 323..332

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

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

            this.facetSearch({
                baseUrl:  '/promises',
                root:     this.promiseSearchTab,
                spinner:  this.promiseSpinner,
                template: this.templates['promise-search-template'],
Severity: Major
Found in app/assets/javascripts/issueEditor.js and 1 other location - About 1 hr to fix
app/assets/javascripts/issueEditor.js on lines 59..66

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

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

            this.facetSearch({
                baseUrl:  '/propositions',
                root:     this.propositionSearchTab,
                spinner:  this.propositionSpinner,
                template: this.templates['proposition-search-template'],
Severity: Major
Found in app/assets/javascripts/issueEditor.js and 1 other location - About 1 hr to fix
app/assets/javascripts/issueEditor.js on lines 50..57

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

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

        widgetOptionsFor: function (el) {
            var path = '', params = {};


            if (this.type === 'issue') {
Severity: Minor
Found in app/assets/javascripts/widgets/widgets.js - About 1 hr to fix

    Method run has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def run
            case @cmd
            when 'json'
              import_files
            when 'daily'
    Severity: Minor
    Found in lib/hdo/import/cli.rb - About 1 hr to fix

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

            if (isHorizontal) {
              if (kc==37 || kc==39) e.preventDefault();
              if (kc == 39) _this.swipeNext()
              if (kc == 37) _this.swipePrev()
            }
      Severity: Major
      Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js and 1 other location - About 1 hr to fix
      app/assets/javascripts/lib/idangerous.swiper-1.8.7.js on lines 677..681

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

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

        case 21:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], stripFlags($$[$0-2], $$[$0]), this._$);
        break;
      Severity: Major
      Found in app/assets/javascripts/lib/handlebars-v1.3.0.js and 3 other locations - About 1 hr to fix
      app/assets/javascripts/lib/handlebars-v1.3.0.js on lines 810..811
      app/assets/javascripts/lib/handlebars-v1.3.0.js on lines 812..813
      app/assets/javascripts/lib/handlebars-v1.3.0.js on lines 816..817

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

      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

            else {
              if (kc==38 || kc==40) e.preventDefault();
              if (kc == 40) _this.swipeNext()
              if (kc == 38) _this.swipePrev()
            }
      Severity: Major
      Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js and 1 other location - About 1 hr to fix
      app/assets/javascripts/lib/idangerous.swiper-1.8.7.js on lines 672..676

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

      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

            if (tlid.length > 0) {
              var tagId = tlid.pop();
              tlis.pop();
              // console.log("TagIdToRemove: " + tagId);
              jQuery("#" + objName + "_" + tagId).remove();
      Severity: Major
      Found in app/assets/javascripts/lib/bootstrap-tagsmanager.js and 1 other location - About 1 hr to fix
      app/assets/javascripts/lib/bootstrap-tagsmanager.js on lines 186..193

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

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

        case 20:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], stripFlags($$[$0-2], $$[$0]), this._$);
        break;
      Severity: Major
      Found in app/assets/javascripts/lib/handlebars-v1.3.0.js and 3 other locations - About 1 hr to fix
      app/assets/javascripts/lib/handlebars-v1.3.0.js on lines 810..811
      app/assets/javascripts/lib/handlebars-v1.3.0.js on lines 812..813
      app/assets/javascripts/lib/handlebars-v1.3.0.js on lines 818..819

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

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

        case 18:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], stripFlags($$[$0-2], $$[$0]), this._$);
        break;
      Severity: Major
      Found in app/assets/javascripts/lib/handlebars-v1.3.0.js and 3 other locations - About 1 hr to fix
      app/assets/javascripts/lib/handlebars-v1.3.0.js on lines 810..811
      app/assets/javascripts/lib/handlebars-v1.3.0.js on lines 816..817
      app/assets/javascripts/lib/handlebars-v1.3.0.js on lines 818..819

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

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

        case 17:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], stripFlags($$[$0-2], $$[$0]), this._$);
        break;
      Severity: Major
      Found in app/assets/javascripts/lib/handlebars-v1.3.0.js and 3 other locations - About 1 hr to fix
      app/assets/javascripts/lib/handlebars-v1.3.0.js on lines 812..813
      app/assets/javascripts/lib/handlebars-v1.3.0.js on lines 816..817
      app/assets/javascripts/lib/handlebars-v1.3.0.js on lines 818..819

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

      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

            while (tlid.length > 0) {
              var tagId = tlid.pop();
              tlis.pop();
              // console.log("TagIdToRemove: " + tagId);
              jQuery("#" + objName + "_" + tagId).remove();
      Severity: Major
      Found in app/assets/javascripts/lib/bootstrap-tagsmanager.js and 1 other location - About 1 hr to fix
      app/assets/javascripts/lib/bootstrap-tagsmanager.js on lines 172..179

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

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

          commandProto.addLinkDef = function (chunk, linkDef) {
      
              var refNumber = 0; // The current reference number
              var defsToAdd = {}; //
              // Start with a clean slate by removing all previous link definitions.
      Severity: Minor
      Found in app/assets/javascripts/lib/pagedown/Markdown.Editor.js - About 1 hr to fix

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

            setupOptions: function(paramSize, params) {
              var options = [], contexts = [], types = [], param, inverse, program;
        
              options.push("hash:" + this.popStack());
        
        
        Severity: Minor
        Found in app/assets/javascripts/lib/handlebars-v1.3.0.js - About 1 hr to fix

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

            , slide: function (type, next) {
                var $active = this.$element.find('.item.active')
                  , $next = next || $active[type]()
                  , isCycling = this.interval
                  , direction = type == 'next' ? 'left' : 'right'
          Severity: Minor
          Found in app/assets/javascripts/twitter/bootstrap/bootstrap-carousel.js - About 1 hr to fix

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

                compile: function(environment, options, context, asObject) {
                  this.environment = environment;
                  this.options = options || {};
            
                  log('debug', this.environment.disassemble() + "\n\n");
            Severity: Minor
            Found in app/assets/javascripts/lib/handlebars-v1.3.0.js - About 1 hr to fix

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

                  var setupTypeahead = function () {
                    if (!obj.typeahead) return;
              
                    if (tagManagerOptions.typeaheadSource != null && jQuery.isFunction(tagManagerOptions.typeaheadSource)) {
                      obj.typeahead({ source: tagManagerOptions.typeaheadSource });
              Severity: Minor
              Found in app/assets/javascripts/lib/bootstrap-tagsmanager.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language