RocketChat/Rocket.Chat.Ops

View on GitHub

Showing 89 of 611 total issues

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

    ProjectRepository.prototype.updateFile = function(params, fn) {
      if (params == null) {
        params = {};
      }
      if (fn == null) {
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectRepository.js on lines 88..103
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectRepository.js on lines 221..236

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

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

    ProjectRepository.prototype.createBranch = function(params, fn) {
      if (params == null) {
        params = {};
      }
      if (fn == null) {
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectRepository.js on lines 221..236
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectRepository.js on lines 238..253

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

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

    ProjectRepository.prototype.createFile = function(params, fn) {
      if (params == null) {
        params = {};
      }
      if (fn == null) {
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectRepository.js on lines 88..103
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectRepository.js on lines 238..253

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

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 ProjectMergeRequests() {
      this.comment = bind(this.comment, this);
      this.update = bind(this.update, this);
      this.add = bind(this.add, this);
      this.show = bind(this.show, this);
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectHooks.js on lines 14..21
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMembers.js on lines 14..21

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

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 ProjectMembers() {
      this.remove = bind(this.remove, this);
      this.update = bind(this.update, this);
      this.add = bind(this.add, this);
      this.show = bind(this.show, this);
Severity: Major
Found in hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMembers.js and 2 other locations - About 4 hrs to fix
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectHooks.js on lines 14..21
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMergeRequests.js on lines 14..21

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

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 ProjectHooks() {
      this.remove = bind(this.remove, this);
      this.update = bind(this.update, this);
      this.add = bind(this.add, this);
      this.show = bind(this.show, this);
Severity: Major
Found in hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectHooks.js and 2 other locations - About 4 hrs to fix
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMembers.js on lines 14..21
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMergeRequests.js on lines 14..21

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

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

    Projects.prototype.listSnippets = function(params, fn) {
      if (params == null) {
        params = {};
      }
      if (fn == null) {
Severity: Major
Found in hubots/hubot-gitsy/src/gitlab/lib/Models/Projects.js and 1 other location - About 4 hrs to fix
hubots/hubot-gitsy/src/gitlab/lib/Models/Projects.js on lines 175..190

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

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

    Projects.prototype.listTags = function(params, fn) {
      if (params == null) {
        params = {};
      }
      if (fn == null) {
Severity: Major
Found in hubots/hubot-gitsy/src/gitlab/lib/Models/Projects.js and 1 other location - About 4 hrs to fix
hubots/hubot-gitsy/src/gitlab/lib/Models/Projects.js on lines 206..221

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

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

    ProjectRepository.prototype.protectBranch = function(projectId, branchId, fn) {
      if (fn == null) {
        fn = null;
      }
      this.debug("Projects::protectBranch()");
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectRepository.js on lines 74..86

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

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

    ProjectRepository.prototype.unprotectBranch = function(projectId, branchId, fn) {
      if (fn == null) {
        fn = null;
      }
      this.debug("Projects::unprotectBranch()");
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectRepository.js on lines 60..72

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

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

    ProjectHooks.prototype.remove = function(projectId, hookId, fn) {
      if (fn == null) {
        fn = null;
      }
      this.debug("Projects::removeHook()");
Severity: Major
Found in hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectHooks.js and 2 other locations - About 4 hrs to fix
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMembers.js on lines 94..106
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectRepository.js on lines 105..117

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

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

    ProjectHooks.prototype.show = function(projectId, hookId, fn) {
      if (fn == null) {
        fn = null;
      }
      this.debug("Projects::hook()");
Severity: Major
Found in hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectHooks.js and 6 other locations - About 4 hrs to fix
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectDeployKeys.js on lines 35..47
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMembers.js on lines 37..49
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMergeRequests.js on lines 50..62
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMilestones.js on lines 68..80
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectRepository.js on lines 46..58
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectRepository.js on lines 147..159

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

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

    ProjectKeys.prototype.getKey = function(projectId, keyId, fn) {
      if (fn == null) {
        fn = null;
      }
      this.debug("ProjectKeys::getKey()");
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectHooks.js on lines 37..49
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMembers.js on lines 37..49
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMergeRequests.js on lines 50..62
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMilestones.js on lines 68..80
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectRepository.js on lines 46..58
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectRepository.js on lines 147..159

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

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

    ProjectRepository.prototype.deleteBranch = function(projectId, branchId, fn) {
      if (fn == null) {
        fn = null;
      }
      this.debug("Projects::deleteBranch()");
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectHooks.js on lines 88..100
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMembers.js on lines 94..106

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

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

    ProjectRepository.prototype.showCommit = function(projectId, commitId, fn) {
      if (fn == null) {
        fn = null;
      }
      this.debug("Projects::commit()");
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectDeployKeys.js on lines 35..47
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectHooks.js on lines 37..49
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMembers.js on lines 37..49
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMergeRequests.js on lines 50..62
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMilestones.js on lines 68..80
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectRepository.js on lines 46..58

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

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

    ProjectMergeRequests.prototype.show = function(projectId, mergerequestId, fn) {
      if (fn == null) {
        fn = null;
      }
      this.debug("Projects::mergerequest()");
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectDeployKeys.js on lines 35..47
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectHooks.js on lines 37..49
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMembers.js on lines 37..49
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMilestones.js on lines 68..80
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectRepository.js on lines 46..58
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectRepository.js on lines 147..159

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

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

    ProjectMembers.prototype.show = function(projectId, userId, fn) {
      if (fn == null) {
        fn = null;
      }
      this.debug("Projects::member()");
Severity: Major
Found in hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMembers.js and 6 other locations - About 4 hrs to fix
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectDeployKeys.js on lines 35..47
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectHooks.js on lines 37..49
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMergeRequests.js on lines 50..62
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMilestones.js on lines 68..80
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectRepository.js on lines 46..58
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectRepository.js on lines 147..159

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

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

    ProjectRepository.prototype.showBranch = function(projectId, branchId, fn) {
      if (fn == null) {
        fn = null;
      }
      this.debug("Projects::branch()");
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectDeployKeys.js on lines 35..47
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectHooks.js on lines 37..49
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMembers.js on lines 37..49
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMergeRequests.js on lines 50..62
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMilestones.js on lines 68..80
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectRepository.js on lines 147..159

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

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

    ProjectMembers.prototype.remove = function(projectId, userId, fn) {
      if (fn == null) {
        fn = null;
      }
      this.debug("Projects::removeMember()");
Severity: Major
Found in hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMembers.js and 2 other locations - About 4 hrs to fix
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectHooks.js on lines 88..100
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectRepository.js on lines 105..117

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

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

    ProjectMilestones.prototype.show = function(projectId, milestoneId, fn) {
      if (fn == null) {
        fn = null;
      }
      this.debug("Projects::milestone()");
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectDeployKeys.js on lines 35..47
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectHooks.js on lines 37..49
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMembers.js on lines 37..49
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectMergeRequests.js on lines 50..62
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectRepository.js on lines 46..58
hubots/hubot-gitsy/src/gitlab/lib/Models/ProjectRepository.js on lines 147..159

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

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