piotrmurach/github

View on GitHub

Showing 129 of 152 total issues

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

    def create(*args)
      arguments(args, required: [:user, :repo]) do
        permit VALID_MILESTONE_INPUTS
        assert_required %w[ title ]
      end
Severity: Minor
Found in lib/github_api/client/issues/milestones.rb and 1 other location - About 20 mins to fix
lib/github_api/client/issues.rb on lines 200..206

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

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

    def create(*args)
      arguments(args, required: [:user, :repo]) do
        permit VALID_ISSUE_PARAM_NAMES
        assert_required %w[ title ]
      end
Severity: Minor
Found in lib/github_api/client/issues.rb and 1 other location - About 20 mins to fix
lib/github_api/client/issues/milestones.rb on lines 94..100

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    def edit(*args)
      arguments(args, required: [:owner, :repo, :id]) do
        permit VALID_ASSET_PARAM_NAMES
      end

Severity: Minor
Found in lib/github_api/client/repos/releases/assets.rb and 3 other locations - About 20 mins to fix
lib/github_api/client/issues.rb on lines 240..245
lib/github_api/client/issues/milestones.rb on lines 125..130
lib/github_api/client/repos/comments.rb on lines 104..109

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    def edit(*args)
      arguments(args, required: [:user, :repo, :number]) do
        permit VALID_ISSUE_PARAM_NAMES
      end

Severity: Minor
Found in lib/github_api/client/issues.rb and 3 other locations - About 20 mins to fix
lib/github_api/client/issues/milestones.rb on lines 125..130
lib/github_api/client/repos/comments.rb on lines 104..109
lib/github_api/client/repos/releases/assets.rb on lines 114..119

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    def update(*args)
      arguments(args, required: [:user, :repo, :number]) do
        permit VALID_MILESTONE_INPUTS
      end

Severity: Minor
Found in lib/github_api/client/issues/milestones.rb and 3 other locations - About 20 mins to fix
lib/github_api/client/issues.rb on lines 240..245
lib/github_api/client/repos/comments.rb on lines 104..109
lib/github_api/client/repos/releases/assets.rb on lines 114..119

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    def update(*args)
      arguments(args, required: [:user, :repo, :id]) do
        assert_required REQUIRED_COMMENT_OPTIONS
      end

Severity: Minor
Found in lib/github_api/client/repos/comments.rb and 3 other locations - About 20 mins to fix
lib/github_api/client/issues.rb on lines 240..245
lib/github_api/client/issues/milestones.rb on lines 125..130
lib/github_api/client/repos/releases/assets.rb on lines 114..119

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

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

    def get(*args)
      arguments(args, required: [:user, :repo, :id])
      params = arguments.params

      get_request("/repos/#{arguments.user}/#{arguments.repo}/issues/comments/#{arguments.id}", params)
Severity: Minor
Found in lib/github_api/client/issues/comments.rb and 5 other locations - About 20 mins to fix
lib/github_api/client/git_data/commits.rb on lines 36..40
lib/github_api/client/git_data/references.rb on lines 130..134
lib/github_api/client/git_data/tags.rb on lines 33..37
lib/github_api/client/issues/events.rb on lines 42..46
lib/github_api/client/issues/labels.rb on lines 59..63

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

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

    def merge(*args)
      arguments(args, required: [:user, :repo]) do
        permit VALID_MERGE_PARAM_NAMES
        assert_required REQUIRED_MERGE_PARAMS
      end
Severity: Minor
Found in lib/github_api/client/repos/merging.rb and 4 other locations - About 20 mins to fix
lib/github_api/client/git_data/blobs.rb on lines 42..48
lib/github_api/client/git_data/commits.rb on lines 92..98
lib/github_api/client/git_data/tags.rb on lines 86..92
lib/github_api/client/issues/labels.rb on lines 80..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 27.

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

    def list_repos(*args)
      arguments(args, required: [:id])

      response = get_request("/teams/#{arguments.id}/repos", arguments.params)
      return response unless block_given?
Severity: Minor
Found in lib/github_api/client/orgs/teams.rb and 4 other locations - About 20 mins to fix
lib/github_api/client/activity/events.rb on lines 115..120
lib/github_api/client/gists/comments.rb on lines 18..24
lib/github_api/client/orgs/hooks.rb on lines 22..27
lib/github_api/client/orgs/teams.rb on lines 182..187

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

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

    def create(*args)
      arguments(args, required: [:user, :repo]) do
        permit VALID_TAG_PARAM_NAMES
        assert_values VALID_TAG_PARAM_VALUES
      end
Severity: Minor
Found in lib/github_api/client/git_data/tags.rb and 4 other locations - About 20 mins to fix
lib/github_api/client/git_data/blobs.rb on lines 42..48
lib/github_api/client/git_data/commits.rb on lines 92..98
lib/github_api/client/issues/labels.rb on lines 80..86
lib/github_api/client/repos/merging.rb on lines 38..44

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

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

    def create(*args)
      arguments(args, required: [:user, :repo]) do
        permit VALID_COMMIT_PARAM_NAMES
        assert_required REQUIRED_COMMIT_PARAMS
      end
Severity: Minor
Found in lib/github_api/client/git_data/commits.rb and 4 other locations - About 20 mins to fix
lib/github_api/client/git_data/blobs.rb on lines 42..48
lib/github_api/client/git_data/tags.rb on lines 86..92
lib/github_api/client/issues/labels.rb on lines 80..86
lib/github_api/client/repos/merging.rb on lines 38..44

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

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

    def list_members(*args)
      arguments(args, required: [:team_id])

      response = get_request("/teams/#{arguments.team_id}/members", arguments.params)
      return response unless block_given?
Severity: Minor
Found in lib/github_api/client/orgs/teams.rb and 4 other locations - About 20 mins to fix
lib/github_api/client/activity/events.rb on lines 115..120
lib/github_api/client/gists/comments.rb on lines 18..24
lib/github_api/client/orgs/hooks.rb on lines 22..27
lib/github_api/client/orgs/teams.rb on lines 338..343

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

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

    def get(*args)
      arguments(args, required: [:user, :repo, :sha])
      params = arguments.params

      get_request("/repos/#{arguments.user}/#{arguments.repo}/git/commits/#{arguments.sha}", params)
Severity: Minor
Found in lib/github_api/client/git_data/commits.rb and 5 other locations - About 20 mins to fix
lib/github_api/client/git_data/references.rb on lines 130..134
lib/github_api/client/git_data/tags.rb on lines 33..37
lib/github_api/client/issues/comments.rb on lines 62..66
lib/github_api/client/issues/events.rb on lines 42..46
lib/github_api/client/issues/labels.rb on lines 59..63

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

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

    def get(*args)
      arguments(args, :required => [:user, :repo, :id])
      params = arguments.params

      get_request("/repos/#{arguments.user}/#{arguments.repo}/issues/events/#{arguments.id}", params)
Severity: Minor
Found in lib/github_api/client/issues/events.rb and 5 other locations - About 20 mins to fix
lib/github_api/client/git_data/commits.rb on lines 36..40
lib/github_api/client/git_data/references.rb on lines 130..134
lib/github_api/client/git_data/tags.rb on lines 33..37
lib/github_api/client/issues/comments.rb on lines 62..66
lib/github_api/client/issues/labels.rb on lines 59..63

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

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

    def list(*args)
      arguments(args, required: [:gist_id])

      response = get_request("/gists/#{arguments.gist_id}/comments",
                             arguments.params)
Severity: Minor
Found in lib/github_api/client/gists/comments.rb and 4 other locations - About 20 mins to fix
lib/github_api/client/activity/events.rb on lines 115..120
lib/github_api/client/orgs/hooks.rb on lines 22..27
lib/github_api/client/orgs/teams.rb on lines 182..187
lib/github_api/client/orgs/teams.rb on lines 338..343

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

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

    def get(*args)
      arguments(args, required: [:user, :repo, :label_name])
      params = arguments.params

      get_request("/repos/#{arguments.user}/#{arguments.repo}/labels/#{arguments.label_name}", params)
Severity: Minor
Found in lib/github_api/client/issues/labels.rb and 5 other locations - About 20 mins to fix
lib/github_api/client/git_data/commits.rb on lines 36..40
lib/github_api/client/git_data/references.rb on lines 130..134
lib/github_api/client/git_data/tags.rb on lines 33..37
lib/github_api/client/issues/comments.rb on lines 62..66
lib/github_api/client/issues/events.rb on lines 42..46

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

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

    def org(*args)
      arguments(args, required: [:name])

      response = get_request("/orgs/#{arguments.name}/events", arguments.params)
      return response unless block_given?
Severity: Minor
Found in lib/github_api/client/activity/events.rb and 4 other locations - About 20 mins to fix
lib/github_api/client/gists/comments.rb on lines 18..24
lib/github_api/client/orgs/hooks.rb on lines 22..27
lib/github_api/client/orgs/teams.rb on lines 182..187
lib/github_api/client/orgs/teams.rb on lines 338..343

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

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

    def get(*args)
      arguments(args, required: [:user, :repo, :sha])
      params = arguments.params

      get_request("/repos/#{arguments.user}/#{arguments.repo}/git/tags/#{arguments.sha}", params)
Severity: Minor
Found in lib/github_api/client/git_data/tags.rb and 5 other locations - About 20 mins to fix
lib/github_api/client/git_data/commits.rb on lines 36..40
lib/github_api/client/git_data/references.rb on lines 130..134
lib/github_api/client/issues/comments.rb on lines 62..66
lib/github_api/client/issues/events.rb on lines 42..46
lib/github_api/client/issues/labels.rb on lines 59..63

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

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

    def create(*args)
      arguments(args, required: [:user, :repo]) do
        permit VALID_LABEL_INPUTS
        assert_required VALID_LABEL_INPUTS
      end
Severity: Minor
Found in lib/github_api/client/issues/labels.rb and 4 other locations - About 20 mins to fix
lib/github_api/client/git_data/blobs.rb on lines 42..48
lib/github_api/client/git_data/commits.rb on lines 92..98
lib/github_api/client/git_data/tags.rb on lines 86..92
lib/github_api/client/repos/merging.rb on lines 38..44

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

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

    def delete(*args)
      arguments(args, required: [:user, :repo, :ref])
      params = arguments.params

      delete_request("/repos/#{arguments.user}/#{arguments.repo}/git/refs/#{arguments.ref}", params)
Severity: Minor
Found in lib/github_api/client/git_data/references.rb and 5 other locations - About 20 mins to fix
lib/github_api/client/git_data/commits.rb on lines 36..40
lib/github_api/client/git_data/tags.rb on lines 33..37
lib/github_api/client/issues/comments.rb on lines 62..66
lib/github_api/client/issues/events.rb on lines 42..46
lib/github_api/client/issues/labels.rb on lines 59..63

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

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