RocketChat/Rocket.Chat.Ops

View on GitHub
hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js

Summary

Maintainability
D
2 days
Test Coverage

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

    Issues.prototype.all = function(params, fn) {
      if (params == null) {
        params = {};
      }
      if (fn == null) {
Severity: Minor
Found in hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js - About 1 hr to fix

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

      var BaseModel, Issues,
        bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
        extend = 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; },
        hasProp = {}.hasOwnProperty;
    Severity: Major
    Found in hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js and 4 other locations - About 6 hrs to fix
    hubots/hubot-gitsy/src/gitlab/lib/ApiV3.js on lines 2..5
    hubots/hubot-gitsy/src/gitlab/lib/Models/Groups.js on lines 2..5
    hubots/hubot-gitsy/src/gitlab/lib/Models/UserKeys.js on lines 2..5
    hubots/hubot-gitsy/src/gitlab/lib/Models/Users.js on lines 2..5

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

    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

        function Issues() {
          this.edit = bind(this.edit, this);
          this.create = bind(this.create, this);
          this.show = bind(this.show, this);
          this.all = bind(this.all, this);
    Severity: Major
    Found in hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js and 1 other location - About 3 hrs to fix
    hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMilestones.js on lines 16..22

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

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

          if (projectId.toString().indexOf("/") !== -1) {
            projectId = encodeURIComponent(projectId);
          } else {
            projectId = parseInt(projectId);
          }
    Severity: Major
    Found in hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js and 4 other locations - About 55 mins to fix
    hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js on lines 70..74
    hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js on lines 92..96
    hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js on lines 112..116
    hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js on lines 117..121

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

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

          if (projectId.toString().indexOf("/") !== -1) {
            projectId = encodeURIComponent(projectId);
          } else {
            projectId = parseInt(projectId);
          }
    Severity: Major
    Found in hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js and 4 other locations - About 55 mins to fix
    hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js on lines 65..69
    hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js on lines 70..74
    hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js on lines 112..116
    hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js on lines 117..121

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

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

          if (issueId.toString().indexOf("/") !== -1) {
            issueId = encodeURIComponent(issueId);
          } else {
            issueId = parseInt(issueId);
          }
    Severity: Major
    Found in hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js and 4 other locations - About 55 mins to fix
    hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js on lines 65..69
    hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js on lines 92..96
    hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js on lines 112..116
    hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js on lines 117..121

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

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

          if (issueId.toString().indexOf("/") !== -1) {
            issueId = encodeURIComponent(issueId);
          } else {
            issueId = parseInt(issueId);
          }
    Severity: Major
    Found in hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js and 4 other locations - About 55 mins to fix
    hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js on lines 65..69
    hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js on lines 70..74
    hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js on lines 92..96
    hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js on lines 112..116

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

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

          if (projectId.toString().indexOf("/") !== -1) {
            projectId = encodeURIComponent(projectId);
          } else {
            projectId = parseInt(projectId);
          }
    Severity: Major
    Found in hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js and 4 other locations - About 55 mins to fix
    hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js on lines 65..69
    hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js on lines 70..74
    hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js on lines 92..96
    hubots/hubot-gitsy/src/gitlab/lib/Models/Issues.js on lines 117..121

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

    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