piotrmurach/github

View on GitHub

Showing 152 of 152 total issues

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

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

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

      response = get_request("/orgs/#{arguments.org_name}/hooks", arguments.params)
      return response unless block_given?
Severity: Minor
Found in lib/github_api/client/orgs/hooks.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/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 5 locations. Consider refactoring.
Open

    def create(*args)
      arguments(args, required: [:user, :repo]) do
        permit VALID_BLOB_PARAM_NAMES
        assert_required VALID_BLOB_PARAM_NAMES
      end
Severity: Minor
Found in lib/github_api/client/git_data/blobs.rb and 4 other locations - About 20 mins to fix
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
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 4 locations. Consider refactoring.
Open

    def get(*args)
      arguments(args, required: [:owner, :repo, :tag]).params

      get_request("/repos/#{arguments.owner}/#{arguments.repo}/releases/tags/#{arguments.tag}" , arguments.params)
Severity: Minor
Found in lib/github_api/client/repos/releases/tags.rb and 3 other locations - About 15 mins to fix
lib/github_api/client/repos/releases.rb on lines 49..52
lib/github_api/client/repos/releases.rb on lines 162..165
lib/github_api/client/repos/releases/assets.rb on lines 39..42

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

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

      get_request("/repos/#{arguments.owner}/#{arguments.repo}/releases/#{arguments.id}" , arguments.params)
Severity: Minor
Found in lib/github_api/client/repos/releases.rb and 3 other locations - About 15 mins to fix
lib/github_api/client/repos/releases.rb on lines 162..165
lib/github_api/client/repos/releases/assets.rb on lines 39..42
lib/github_api/client/repos/releases/tags.rb on lines 17..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 26.

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

      post_request("/repos/#{arguments.user}/#{arguments.repo}/hooks/#{arguments.id}/pings", arguments.params)
Severity: Minor
Found in lib/github_api/client/repos/hooks.rb and 5 other locations - About 15 mins to fix
lib/github_api/client/pull_requests/comments.rb on lines 60..63
lib/github_api/client/pull_requests/comments.rb on lines 103..106
lib/github_api/client/repos/branches/protections.rb on lines 23..26
lib/github_api/client/repos/branches/protections.rb on lines 68..71
lib/github_api/client/repos/hooks.rb on lines 180..183

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

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, :branch])

      get_request("/repos/#{arguments.user}/#{arguments.repo}/branches/#{arguments.branch}/protection", arguments.params)
Severity: Minor
Found in lib/github_api/client/repos/branches/protections.rb and 5 other locations - About 15 mins to fix
lib/github_api/client/pull_requests/comments.rb on lines 60..63
lib/github_api/client/pull_requests/comments.rb on lines 103..106
lib/github_api/client/repos/branches/protections.rb on lines 68..71
lib/github_api/client/repos/hooks.rb on lines 180..183
lib/github_api/client/repos/hooks.rb on lines 195..198

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

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

      get_request("/repos/#{arguments.owner}/#{arguments.repo}/releases/assets/#{arguments.id}" , arguments.params)
Severity: Minor
Found in lib/github_api/client/repos/releases/assets.rb and 3 other locations - About 15 mins to fix
lib/github_api/client/repos/releases.rb on lines 49..52
lib/github_api/client/repos/releases.rb on lines 162..165
lib/github_api/client/repos/releases/tags.rb on lines 17..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 26.

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

      post_request("/repos/#{arguments.user}/#{arguments.repo}/hooks/#{arguments.id}/tests", arguments.params)
Severity: Minor
Found in lib/github_api/client/repos/hooks.rb and 5 other locations - About 15 mins to fix
lib/github_api/client/pull_requests/comments.rb on lines 60..63
lib/github_api/client/pull_requests/comments.rb on lines 103..106
lib/github_api/client/repos/branches/protections.rb on lines 23..26
lib/github_api/client/repos/branches/protections.rb on lines 68..71
lib/github_api/client/repos/hooks.rb on lines 195..198

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

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 create(*args)
      arguments(args, required: [:user, :repo, :number])

      post_request("/repos/#{arguments.user}/#{arguments.repo}/pulls/#{arguments.number}/comments", arguments.params)
Severity: Minor
Found in lib/github_api/client/pull_requests/comments.rb and 5 other locations - About 15 mins to fix
lib/github_api/client/pull_requests/comments.rb on lines 60..63
lib/github_api/client/repos/branches/protections.rb on lines 23..26
lib/github_api/client/repos/branches/protections.rb on lines 68..71
lib/github_api/client/repos/hooks.rb on lines 180..183
lib/github_api/client/repos/hooks.rb on lines 195..198

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

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, :branch])

      delete_request("/repos/#{arguments.user}/#{arguments.repo}/branches/#{arguments.branch}/protection", arguments.params)
Severity: Minor
Found in lib/github_api/client/repos/branches/protections.rb and 5 other locations - About 15 mins to fix
lib/github_api/client/pull_requests/comments.rb on lines 60..63
lib/github_api/client/pull_requests/comments.rb on lines 103..106
lib/github_api/client/repos/branches/protections.rb on lines 23..26
lib/github_api/client/repos/hooks.rb on lines 180..183
lib/github_api/client/repos/hooks.rb on lines 195..198

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

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, :number])

      get_request("/repos/#{arguments.user}/#{arguments.repo}/pulls/#{arguments.number}/comments", arguments.params)
Severity: Minor
Found in lib/github_api/client/pull_requests/comments.rb and 5 other locations - About 15 mins to fix
lib/github_api/client/pull_requests/comments.rb on lines 103..106
lib/github_api/client/repos/branches/protections.rb on lines 23..26
lib/github_api/client/repos/branches/protections.rb on lines 68..71
lib/github_api/client/repos/hooks.rb on lines 180..183
lib/github_api/client/repos/hooks.rb on lines 195..198

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

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 delete(*args)
      arguments(args, required: [:owner, :repo, :id]).params

      delete_request("/repos/#{arguments.owner}/#{arguments.repo}/releases/#{arguments.id}", arguments.params)
Severity: Minor
Found in lib/github_api/client/repos/releases.rb and 3 other locations - About 15 mins to fix
lib/github_api/client/repos/releases.rb on lines 49..52
lib/github_api/client/repos/releases/assets.rb on lines 39..42
lib/github_api/client/repos/releases/tags.rb on lines 17..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 26.

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

      patch_request("/repos/#{arguments.owner}/#{arguments.repo}/releases/#{arguments.id}", arguments.params)
Severity: Major
Found in lib/github_api/client/repos/releases.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/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}/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 56..59
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 28 locations. Consider refactoring.
Open

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

      get_request("/repos/#{arguments.user}/#{arguments.repo}/milestones/#{arguments.number}", arguments.params)
Severity: Major
Found in lib/github_api/client/issues/milestones.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 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

Severity
Category
Status
Source
Language