piotrmurach/github

View on GitHub

Showing 152 of 152 total issues

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

    def delete(*args)
      arguments(args, required: [:owner, :repo, :id])

      delete_request("/repos/#{arguments.owner}/#{arguments.repo}/releases/assets/#{arguments.id}", arguments.params)
Severity: Major
Found in lib/github_api/client/repos/releases/assets.rb and 27 other locations - About 15 mins to fix
lib/github_api/client/git_data/blobs.rb on lines 20..23
lib/github_api/client/issues.rb on lines 161..164
lib/github_api/client/issues/comments.rb on lines 140..143
lib/github_api/client/issues/labels.rb on lines 120..123
lib/github_api/client/issues/milestones.rb on lines 66..69
lib/github_api/client/issues/milestones.rb on lines 140..143
lib/github_api/client/orgs/teams.rb on lines 380..383
lib/github_api/client/orgs/teams.rb on lines 400..403
lib/github_api/client/pull_requests.rb on lines 46..49
lib/github_api/client/pull_requests.rb on lines 115..118
lib/github_api/client/pull_requests/comments.rb on lines 121..124
lib/github_api/client/pull_requests/comments.rb on lines 134..137
lib/github_api/client/repos/branches.rb on lines 41..44
lib/github_api/client/repos/collaborators.rb on lines 44..47
lib/github_api/client/repos/collaborators.rb on lines 78..81
lib/github_api/client/repos/comments.rb on lines 56..59
lib/github_api/client/repos/comments.rb on lines 119..122
lib/github_api/client/repos/commits.rb on lines 56..59
lib/github_api/client/repos/contents.rb on lines 73..76
lib/github_api/client/repos/downloads.rb on lines 41..44
lib/github_api/client/repos/downloads.rb on lines 55..58
lib/github_api/client/repos/hooks.rb on lines 64..67
lib/github_api/client/repos/hooks.rb on lines 208..211
lib/github_api/client/repos/invitations.rb on lines 35..38
lib/github_api/client/repos/keys.rb on lines 47..50
lib/github_api/client/repos/keys.rb on lines 97..100
lib/github_api/client/repos/releases.rb on lines 140..143

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

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

    def remove(*args)
      arguments(args, required: [:user, :repo, :username])

      delete_request("/repos/#{arguments.user}/#{arguments.repo}/collaborators/#{arguments.username}", arguments.params)
Severity: Major
Found in lib/github_api/client/repos/collaborators.rb and 27 other locations - About 15 mins to fix
lib/github_api/client/git_data/blobs.rb on lines 20..23
lib/github_api/client/issues.rb on lines 161..164
lib/github_api/client/issues/comments.rb on lines 140..143
lib/github_api/client/issues/labels.rb on lines 120..123
lib/github_api/client/issues/milestones.rb on lines 66..69
lib/github_api/client/issues/milestones.rb on lines 140..143
lib/github_api/client/orgs/teams.rb on lines 380..383
lib/github_api/client/orgs/teams.rb on lines 400..403
lib/github_api/client/pull_requests.rb on lines 46..49
lib/github_api/client/pull_requests.rb on lines 115..118
lib/github_api/client/pull_requests/comments.rb on lines 121..124
lib/github_api/client/pull_requests/comments.rb on lines 134..137
lib/github_api/client/repos/branches.rb on lines 41..44
lib/github_api/client/repos/collaborators.rb on lines 44..47
lib/github_api/client/repos/comments.rb on lines 56..59
lib/github_api/client/repos/comments.rb on lines 119..122
lib/github_api/client/repos/commits.rb on lines 56..59
lib/github_api/client/repos/contents.rb on lines 73..76
lib/github_api/client/repos/downloads.rb on lines 41..44
lib/github_api/client/repos/downloads.rb on lines 55..58
lib/github_api/client/repos/hooks.rb on lines 64..67
lib/github_api/client/repos/hooks.rb on lines 208..211
lib/github_api/client/repos/invitations.rb on lines 35..38
lib/github_api/client/repos/keys.rb on lines 47..50
lib/github_api/client/repos/keys.rb on lines 97..100
lib/github_api/client/repos/releases.rb on lines 140..143
lib/github_api/client/repos/releases/assets.rb on lines 130..133

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

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

    def delete(*args)
      arguments(args, required: [:user, :repo, :id])

      delete_request("/repos/#{arguments.user}/#{arguments.repo}/keys/#{arguments.id}", arguments.params)
Severity: Major
Found in lib/github_api/client/repos/keys.rb and 27 other locations - About 15 mins to fix
lib/github_api/client/git_data/blobs.rb on lines 20..23
lib/github_api/client/issues.rb on lines 161..164
lib/github_api/client/issues/comments.rb on lines 140..143
lib/github_api/client/issues/labels.rb on lines 120..123
lib/github_api/client/issues/milestones.rb on lines 66..69
lib/github_api/client/issues/milestones.rb on lines 140..143
lib/github_api/client/orgs/teams.rb on lines 380..383
lib/github_api/client/orgs/teams.rb on lines 400..403
lib/github_api/client/pull_requests.rb on lines 46..49
lib/github_api/client/pull_requests.rb on lines 115..118
lib/github_api/client/pull_requests/comments.rb on lines 121..124
lib/github_api/client/pull_requests/comments.rb on lines 134..137
lib/github_api/client/repos/branches.rb on lines 41..44
lib/github_api/client/repos/collaborators.rb on lines 44..47
lib/github_api/client/repos/collaborators.rb on lines 78..81
lib/github_api/client/repos/comments.rb on lines 56..59
lib/github_api/client/repos/comments.rb on lines 119..122
lib/github_api/client/repos/commits.rb on lines 56..59
lib/github_api/client/repos/contents.rb on lines 73..76
lib/github_api/client/repos/downloads.rb on lines 41..44
lib/github_api/client/repos/downloads.rb on lines 55..58
lib/github_api/client/repos/hooks.rb on lines 64..67
lib/github_api/client/repos/hooks.rb on lines 208..211
lib/github_api/client/repos/invitations.rb on lines 35..38
lib/github_api/client/repos/keys.rb on lines 47..50
lib/github_api/client/repos/releases.rb on lines 140..143
lib/github_api/client/repos/releases/assets.rb on lines 130..133

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

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

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

      get_request("/repos/#{arguments.user}/#{arguments.repo}/hooks/#{arguments.id}", arguments.params)
Severity: Major
Found in lib/github_api/client/repos/hooks.rb and 27 other locations - About 15 mins to fix
lib/github_api/client/git_data/blobs.rb on lines 20..23
lib/github_api/client/issues.rb on lines 161..164
lib/github_api/client/issues/comments.rb on lines 140..143
lib/github_api/client/issues/labels.rb on lines 120..123
lib/github_api/client/issues/milestones.rb on lines 66..69
lib/github_api/client/issues/milestones.rb on lines 140..143
lib/github_api/client/orgs/teams.rb on lines 380..383
lib/github_api/client/orgs/teams.rb on lines 400..403
lib/github_api/client/pull_requests.rb on lines 46..49
lib/github_api/client/pull_requests.rb on lines 115..118
lib/github_api/client/pull_requests/comments.rb on lines 121..124
lib/github_api/client/pull_requests/comments.rb on lines 134..137
lib/github_api/client/repos/branches.rb on lines 41..44
lib/github_api/client/repos/collaborators.rb on lines 44..47
lib/github_api/client/repos/collaborators.rb on lines 78..81
lib/github_api/client/repos/comments.rb on lines 56..59
lib/github_api/client/repos/comments.rb on lines 119..122
lib/github_api/client/repos/commits.rb on lines 56..59
lib/github_api/client/repos/contents.rb on lines 73..76
lib/github_api/client/repos/downloads.rb on lines 41..44
lib/github_api/client/repos/downloads.rb on lines 55..58
lib/github_api/client/repos/hooks.rb on lines 208..211
lib/github_api/client/repos/invitations.rb on lines 35..38
lib/github_api/client/repos/keys.rb on lines 47..50
lib/github_api/client/repos/keys.rb on lines 97..100
lib/github_api/client/repos/releases.rb on lines 140..143
lib/github_api/client/repos/releases/assets.rb on lines 130..133

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

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

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

      get_request("/repos/#{arguments.user}/#{arguments.repo}/comments/#{arguments.id}", arguments.params)
Severity: Major
Found in lib/github_api/client/repos/comments.rb and 27 other locations - About 15 mins to fix
lib/github_api/client/git_data/blobs.rb on lines 20..23
lib/github_api/client/issues.rb on lines 161..164
lib/github_api/client/issues/comments.rb on lines 140..143
lib/github_api/client/issues/labels.rb on lines 120..123
lib/github_api/client/issues/milestones.rb on lines 66..69
lib/github_api/client/issues/milestones.rb on lines 140..143
lib/github_api/client/orgs/teams.rb on lines 380..383
lib/github_api/client/orgs/teams.rb on lines 400..403
lib/github_api/client/pull_requests.rb on lines 46..49
lib/github_api/client/pull_requests.rb on lines 115..118
lib/github_api/client/pull_requests/comments.rb on lines 121..124
lib/github_api/client/pull_requests/comments.rb on lines 134..137
lib/github_api/client/repos/branches.rb on lines 41..44
lib/github_api/client/repos/collaborators.rb on lines 44..47
lib/github_api/client/repos/collaborators.rb on lines 78..81
lib/github_api/client/repos/comments.rb on lines 119..122
lib/github_api/client/repos/commits.rb on lines 56..59
lib/github_api/client/repos/contents.rb on lines 73..76
lib/github_api/client/repos/downloads.rb on lines 41..44
lib/github_api/client/repos/downloads.rb on lines 55..58
lib/github_api/client/repos/hooks.rb on lines 64..67
lib/github_api/client/repos/hooks.rb on lines 208..211
lib/github_api/client/repos/invitations.rb on lines 35..38
lib/github_api/client/repos/keys.rb on lines 47..50
lib/github_api/client/repos/keys.rb on lines 97..100
lib/github_api/client/repos/releases.rb on lines 140..143
lib/github_api/client/repos/releases/assets.rb on lines 130..133

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

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 update(*args)
      arguments(args, required: [:card_id])
      params = arguments.params

      params["accept"] ||= ::Github::Client::Projects::PREVIEW_MEDIA
Severity: Minor
Found in lib/github_api/client/projects/cards.rb and 4 other locations - About 15 mins to fix
lib/github_api/client/projects/cards.rb on lines 41..47
lib/github_api/client/projects/cards.rb on lines 118..124
lib/github_api/client/projects/columns.rb on lines 42..48
lib/github_api/client/projects/columns.rb 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 25.

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

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

      get_request("/repos/#{arguments.user}/#{arguments.repo}/keys/#{arguments.id}", arguments.params)
Severity: Major
Found in lib/github_api/client/repos/keys.rb and 27 other locations - About 15 mins to fix
lib/github_api/client/git_data/blobs.rb on lines 20..23
lib/github_api/client/issues.rb on lines 161..164
lib/github_api/client/issues/comments.rb on lines 140..143
lib/github_api/client/issues/labels.rb on lines 120..123
lib/github_api/client/issues/milestones.rb on lines 66..69
lib/github_api/client/issues/milestones.rb on lines 140..143
lib/github_api/client/orgs/teams.rb on lines 380..383
lib/github_api/client/orgs/teams.rb on lines 400..403
lib/github_api/client/pull_requests.rb on lines 46..49
lib/github_api/client/pull_requests.rb on lines 115..118
lib/github_api/client/pull_requests/comments.rb on lines 121..124
lib/github_api/client/pull_requests/comments.rb on lines 134..137
lib/github_api/client/repos/branches.rb on lines 41..44
lib/github_api/client/repos/collaborators.rb on lines 44..47
lib/github_api/client/repos/collaborators.rb on lines 78..81
lib/github_api/client/repos/comments.rb on lines 56..59
lib/github_api/client/repos/comments.rb on lines 119..122
lib/github_api/client/repos/commits.rb on lines 56..59
lib/github_api/client/repos/contents.rb on lines 73..76
lib/github_api/client/repos/downloads.rb on lines 41..44
lib/github_api/client/repos/downloads.rb on lines 55..58
lib/github_api/client/repos/hooks.rb on lines 64..67
lib/github_api/client/repos/hooks.rb on lines 208..211
lib/github_api/client/repos/invitations.rb on lines 35..38
lib/github_api/client/repos/keys.rb on lines 97..100
lib/github_api/client/repos/releases.rb on lines 140..143
lib/github_api/client/repos/releases/assets.rb on lines 130..133

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

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

    def delete(*args)
      arguments(args, required: [:user, :repo, :number])

      delete_request("/repos/#{arguments.user}/#{arguments.repo}/pulls/comments/#{arguments.number}", arguments.params)
Severity: Major
Found in lib/github_api/client/pull_requests/comments.rb and 27 other locations - About 15 mins to fix
lib/github_api/client/git_data/blobs.rb on lines 20..23
lib/github_api/client/issues.rb on lines 161..164
lib/github_api/client/issues/comments.rb on lines 140..143
lib/github_api/client/issues/labels.rb on lines 120..123
lib/github_api/client/issues/milestones.rb on lines 66..69
lib/github_api/client/issues/milestones.rb on lines 140..143
lib/github_api/client/orgs/teams.rb on lines 380..383
lib/github_api/client/orgs/teams.rb on lines 400..403
lib/github_api/client/pull_requests.rb on lines 46..49
lib/github_api/client/pull_requests.rb on lines 115..118
lib/github_api/client/pull_requests/comments.rb on lines 121..124
lib/github_api/client/repos/branches.rb on lines 41..44
lib/github_api/client/repos/collaborators.rb on lines 44..47
lib/github_api/client/repos/collaborators.rb on lines 78..81
lib/github_api/client/repos/comments.rb on lines 56..59
lib/github_api/client/repos/comments.rb on lines 119..122
lib/github_api/client/repos/commits.rb on lines 56..59
lib/github_api/client/repos/contents.rb on lines 73..76
lib/github_api/client/repos/downloads.rb on lines 41..44
lib/github_api/client/repos/downloads.rb on lines 55..58
lib/github_api/client/repos/hooks.rb on lines 64..67
lib/github_api/client/repos/hooks.rb on lines 208..211
lib/github_api/client/repos/invitations.rb on lines 35..38
lib/github_api/client/repos/keys.rb on lines 47..50
lib/github_api/client/repos/keys.rb on lines 97..100
lib/github_api/client/repos/releases.rb on lines 140..143
lib/github_api/client/repos/releases/assets.rb on lines 130..133

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

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

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

      get_request("/repos/#{arguments.user}/#{arguments.repo}/git/blobs/#{arguments.sha}", arguments.params)
Severity: Major
Found in lib/github_api/client/git_data/blobs.rb and 27 other locations - About 15 mins to fix
lib/github_api/client/issues.rb on lines 161..164
lib/github_api/client/issues/comments.rb on lines 140..143
lib/github_api/client/issues/labels.rb on lines 120..123
lib/github_api/client/issues/milestones.rb on lines 66..69
lib/github_api/client/issues/milestones.rb on lines 140..143
lib/github_api/client/orgs/teams.rb on lines 380..383
lib/github_api/client/orgs/teams.rb on lines 400..403
lib/github_api/client/pull_requests.rb on lines 46..49
lib/github_api/client/pull_requests.rb on lines 115..118
lib/github_api/client/pull_requests/comments.rb on lines 121..124
lib/github_api/client/pull_requests/comments.rb on lines 134..137
lib/github_api/client/repos/branches.rb on lines 41..44
lib/github_api/client/repos/collaborators.rb on lines 44..47
lib/github_api/client/repos/collaborators.rb on lines 78..81
lib/github_api/client/repos/comments.rb on lines 56..59
lib/github_api/client/repos/comments.rb on lines 119..122
lib/github_api/client/repos/commits.rb on lines 56..59
lib/github_api/client/repos/contents.rb on lines 73..76
lib/github_api/client/repos/downloads.rb on lines 41..44
lib/github_api/client/repos/downloads.rb on lines 55..58
lib/github_api/client/repos/hooks.rb on lines 64..67
lib/github_api/client/repos/hooks.rb on lines 208..211
lib/github_api/client/repos/invitations.rb on lines 35..38
lib/github_api/client/repos/keys.rb on lines 47..50
lib/github_api/client/repos/keys.rb on lines 97..100
lib/github_api/client/repos/releases.rb on lines 140..143
lib/github_api/client/repos/releases/assets.rb on lines 130..133

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

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

    def add_repo(*args)
      arguments(args, required: [:id, :user, :repo])

      put_request("/teams/#{arguments.id}/repos/#{arguments.user}/#{arguments.repo}", arguments.params)
Severity: Major
Found in lib/github_api/client/orgs/teams.rb and 27 other locations - About 15 mins to fix
lib/github_api/client/git_data/blobs.rb on lines 20..23
lib/github_api/client/issues.rb on lines 161..164
lib/github_api/client/issues/comments.rb on lines 140..143
lib/github_api/client/issues/labels.rb on lines 120..123
lib/github_api/client/issues/milestones.rb on lines 66..69
lib/github_api/client/issues/milestones.rb on lines 140..143
lib/github_api/client/orgs/teams.rb on lines 400..403
lib/github_api/client/pull_requests.rb on lines 46..49
lib/github_api/client/pull_requests.rb on lines 115..118
lib/github_api/client/pull_requests/comments.rb on lines 121..124
lib/github_api/client/pull_requests/comments.rb on lines 134..137
lib/github_api/client/repos/branches.rb on lines 41..44
lib/github_api/client/repos/collaborators.rb on lines 44..47
lib/github_api/client/repos/collaborators.rb on lines 78..81
lib/github_api/client/repos/comments.rb on lines 56..59
lib/github_api/client/repos/comments.rb on lines 119..122
lib/github_api/client/repos/commits.rb on lines 56..59
lib/github_api/client/repos/contents.rb on lines 73..76
lib/github_api/client/repos/downloads.rb on lines 41..44
lib/github_api/client/repos/downloads.rb on lines 55..58
lib/github_api/client/repos/hooks.rb on lines 64..67
lib/github_api/client/repos/hooks.rb on lines 208..211
lib/github_api/client/repos/invitations.rb on lines 35..38
lib/github_api/client/repos/keys.rb on lines 47..50
lib/github_api/client/repos/keys.rb on lines 97..100
lib/github_api/client/repos/releases.rb on lines 140..143
lib/github_api/client/repos/releases/assets.rb on lines 130..133

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

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 get(*args)
      arguments(args, required: [:card_id])
      params = arguments.params

      params["accept"] ||= ::Github::Client::Projects::PREVIEW_MEDIA
Severity: Minor
Found in lib/github_api/client/projects/cards.rb and 4 other locations - About 15 mins to fix
lib/github_api/client/projects/cards.rb on lines 99..105
lib/github_api/client/projects/cards.rb on lines 118..124
lib/github_api/client/projects/columns.rb on lines 42..48
lib/github_api/client/projects/columns.rb 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 25.

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 forks(*args)
      arguments(args, required: [:id])

      response = get_request("/gists/#{arguments.id}/forks")
      return response unless block_given?
Severity: Minor
Found in lib/github_api/client/gists.rb and 1 other location - About 15 mins to fix
lib/github_api/client/gists.rb on lines 189..194

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

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