RocketChat/Rocket.Chat.Ops

View on GitHub

Showing 89 of 611 total issues

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

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

      results.push(console.log("#" + project.id + ": " + project.name + ", path: " + project.path + ", default_branch: " + project.default_branch + ", private: " + project["private"] + ", owner: " + project.owner.name + " (" + project.owner.email + "), date: " + project.created_at));
Severity: Minor
Found in hubots/hubot-gitsy/src/gitlab/examples/list-projects.js and 1 other location - About 30 mins to fix
hubots/hubot-gitsy/src/gitlab/examples/list-users.js on lines 20..20

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

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

      results.push(console.log("#" + user.id + ": " + user.email + ", " + user.name + ", " + user.created_at));
Severity: Minor
Found in hubots/hubot-gitsy/src/gitlab/examples/list-users.js and 1 other location - About 30 mins to fix
hubots/hubot-gitsy/src/gitlab/examples/list-projects.js on lines 20..20

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

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