RocketChat/Rocket.Chat.Ops

View on GitHub

Showing 611 of 611 total issues

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

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

    Function addMember has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        Groups.prototype.addMember = function(groupId, userId, accessLevel, fn) {
          var checkAccessLevel, params;
          if (fn == null) {
            fn = null;
          }
    Severity: Minor
    Found in hubots/hubot-gitsy/src/gitlab/lib/Models/Groups.js - About 1 hr to fix

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

            return this.get("groups/" + (parseInt(groupId)) + "/members", (function(_this) {
              return function(data) {
                if (fn) {
                  return fn(data);
                }
      Severity: Major
      Found in hubots/hubot-gitsy/src/gitlab/lib/Models/Groups.js and 1 other location - About 1 hr to fix
      hubots/hubot-gitsy/src/gitlab/lib/Models/UserKeys.js on lines 21..27

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

      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

            return this.get("users/" + (parseInt(userId)) + "/keys", (function(_this) {
              return function(data) {
                if (fn) {
                  return fn(data);
                }
      Severity: Major
      Found in hubots/hubot-gitsy/src/gitlab/lib/Models/UserKeys.js and 1 other location - About 1 hr to fix
      hubots/hubot-gitsy/src/gitlab/lib/Models/Groups.js on lines 110..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 57.

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

        module.exports.ApiBase = (function() {
          function ApiBase(options) {
            this.options = options;
            this.init = bind(this.init, this);
            this.handleOptions = bind(this.handleOptions, this);
      Severity: Minor
      Found in hubots/hubot-gitsy/src/gitlab/lib/ApiBase.js - About 1 hr to fix

        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

        Function update has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            ProjectMilestones.prototype.update = function(projectId, milestoneId, title, description, due_date, state_event, fn) {
        Severity: Major
        Found in hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMilestones.js - About 50 mins to fix

          Function add has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              ProjectMergeRequests.prototype.add = function(projectId, sourceBranch, targetBranch, assigneeId, title, fn) {
          Severity: Minor
          Found in hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMergeRequests.js - About 45 mins to fix

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

                function Labels() {
                  this.create = bind(this.create, this);
                  return Labels.__super__.constructor.apply(this, arguments);
                }
            Severity: Major
            Found in hubots/hubot-gitsy/src/gitlab/lib/Models/Labels.js and 5 other locations - About 40 mins to fix
            hubots/hubot-gitsy/src/gitlab/lib/ApiV3.js on lines 14..17
            hubots/hubot-gitsy/src/gitlab/lib/Models/IssueNotes.js on lines 14..17
            hubots/hubot-gitsy/src/gitlab/lib/Models/Notes.js on lines 14..17
            hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectLabels.js on lines 14..17
            hubots/hubot-gitsy/src/gitlab/lib/Models/UserKeys.js on lines 12..15

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

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

                function IssueNotes() {
                  this.all = bind(this.all, this);
                  return IssueNotes.__super__.constructor.apply(this, arguments);
                }
            Severity: Major
            Found in hubots/hubot-gitsy/src/gitlab/lib/Models/IssueNotes.js and 5 other locations - About 40 mins to fix
            hubots/hubot-gitsy/src/gitlab/lib/ApiV3.js on lines 14..17
            hubots/hubot-gitsy/src/gitlab/lib/Models/Labels.js on lines 14..17
            hubots/hubot-gitsy/src/gitlab/lib/Models/Notes.js on lines 14..17
            hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectLabels.js on lines 14..17
            hubots/hubot-gitsy/src/gitlab/lib/Models/UserKeys.js on lines 12..15

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

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

                function UserKeys() {
                  this.all = bind(this.all, this);
                  return UserKeys.__super__.constructor.apply(this, arguments);
                }
            Severity: Major
            Found in hubots/hubot-gitsy/src/gitlab/lib/Models/UserKeys.js and 5 other locations - About 40 mins to fix
            hubots/hubot-gitsy/src/gitlab/lib/ApiV3.js on lines 14..17
            hubots/hubot-gitsy/src/gitlab/lib/Models/IssueNotes.js on lines 14..17
            hubots/hubot-gitsy/src/gitlab/lib/Models/Labels.js on lines 14..17
            hubots/hubot-gitsy/src/gitlab/lib/Models/Notes.js on lines 14..17
            hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectLabels.js on lines 14..17

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

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

                function Notes() {
                  this.create = bind(this.create, this);
                  return Notes.__super__.constructor.apply(this, arguments);
                }
            Severity: Major
            Found in hubots/hubot-gitsy/src/gitlab/lib/Models/Notes.js and 5 other locations - About 40 mins to fix
            hubots/hubot-gitsy/src/gitlab/lib/ApiV3.js on lines 14..17
            hubots/hubot-gitsy/src/gitlab/lib/Models/IssueNotes.js on lines 14..17
            hubots/hubot-gitsy/src/gitlab/lib/Models/Labels.js on lines 14..17
            hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectLabels.js on lines 14..17
            hubots/hubot-gitsy/src/gitlab/lib/Models/UserKeys.js on lines 12..15

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

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

                function ApiV3() {
                  this.handleOptions = bind(this.handleOptions, this);
                  return ApiV3.__super__.constructor.apply(this, arguments);
                }
            Severity: Major
            Found in hubots/hubot-gitsy/src/gitlab/lib/ApiV3.js and 5 other locations - About 40 mins to fix
            hubots/hubot-gitsy/src/gitlab/lib/Models/IssueNotes.js on lines 14..17
            hubots/hubot-gitsy/src/gitlab/lib/Models/Labels.js on lines 14..17
            hubots/hubot-gitsy/src/gitlab/lib/Models/Notes.js on lines 14..17
            hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectLabels.js on lines 14..17
            hubots/hubot-gitsy/src/gitlab/lib/Models/UserKeys.js on lines 12..15

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

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

                function ProjectLabels() {
                  this.all = bind(this.all, this);
                  return ProjectLabels.__super__.constructor.apply(this, arguments);
                }
            Severity: Major
            Found in hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectLabels.js and 5 other locations - About 40 mins to fix
            hubots/hubot-gitsy/src/gitlab/lib/ApiV3.js on lines 14..17
            hubots/hubot-gitsy/src/gitlab/lib/Models/IssueNotes.js on lines 14..17
            hubots/hubot-gitsy/src/gitlab/lib/Models/Labels.js on lines 14..17
            hubots/hubot-gitsy/src/gitlab/lib/Models/Notes.js on lines 14..17
            hubots/hubot-gitsy/src/gitlab/lib/Models/UserKeys.js on lines 12..15

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

            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

                  return this.get("projects/" + (Utils.parseProjectId(projectId)), (function(_this) {
                    return function(data) {
                      if (fn) {
                        return fn(data);
                      }
            Severity: Minor
            Found in hubots/hubot-gitsy/src/gitlab/lib/Models/Projects.js and 1 other location - About 40 mins to fix
            hubots/hubot-gitsy/src/gitlab/lib/Models/Projects.js on lines 197..203

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

            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

                  return this["delete"]("projects/" + (Utils.parseProjectId(projectId)), (function(_this) {
                    return function(data) {
                      if (fn) {
                        return fn(data);
                      }
            Severity: Minor
            Found in hubots/hubot-gitsy/src/gitlab/lib/Models/Projects.js and 1 other location - About 40 mins to fix
            hubots/hubot-gitsy/src/gitlab/lib/Models/Projects.js on lines 89..95

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

            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

            Severity
            Category
            Status
            Source
            Language