piotrmurach/github

View on GitHub

Showing 129 of 152 total issues

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

    def contributors(*args)
      arguments(args, required: [:user, :repo]) do
        permit %w[ anon ]
      end

Severity: Minor
Found in lib/github_api/client/repos.rb and 1 other location - About 35 mins to fix
lib/github_api/client/repos.rb on lines 403..410

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

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

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

    def contributors(*args)
      arguments(args, required: [:user, :repo]) do
        permit ['anon']
      end

Severity: Minor
Found in lib/github_api/client/repos.rb and 1 other location - About 35 mins to fix
lib/github_api/client/repos.rb on lines 288..295

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

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, :sha]) do
        permit VALID_STATUS_PARAM_NAMES, recursive: false
        assert_required REQUIRED_PARAMS
      end
Severity: Minor
Found in lib/github_api/client/repos/statuses.rb and 1 other location - About 35 mins to fix
lib/github_api/client/repos/hooks.rb on lines 159..165

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

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 edit(*args)
      arguments(args, required: [:user, :repo, :id]) do
        permit VALID_HOOK_PARAM_NAMES, recursive: false
        assert_required REQUIRED_PARAMS
      end
Severity: Minor
Found in lib/github_api/client/repos/hooks.rb and 1 other location - About 35 mins to fix
lib/github_api/client/repos/statuses.rb on lines 82..88

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

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

      params             = arguments.params
      params["accept"] ||= PREVIEW_MEDIA
Severity: Minor
Found in lib/github_api/client/pull_requests/reviews.rb and 1 other location - About 30 mins to fix
lib/github_api/client/pull_requests.rb on lines 187..192

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

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 merge(*args)
      arguments(args, required: [:user, :repo, :number])
      params = arguments.params
      params['accept'] ||= PREVIEW_MEDIA

Severity: Minor
Found in lib/github_api/client/pull_requests.rb and 1 other location - About 30 mins to fix
lib/github_api/client/pull_requests/reviews.rb on lines 86..92

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

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

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

      response = get_request("/repos/#{arguments.user}/#{arguments.repo}/subscribers", arguments.params)
      return response unless block_given?
Severity: Major
Found in lib/github_api/client/activity/watching.rb and 20 other locations - About 30 mins to fix
lib/github_api/client/activity/events.rb on lines 40..45
lib/github_api/client/activity/events.rb on lines 64..69
lib/github_api/client/activity/events.rb on lines 89..94
lib/github_api/client/activity/starring.rb on lines 20..25
lib/github_api/client/issues/assignees.rb on lines 15..20
lib/github_api/client/pull_requests.rb on lines 27..33
lib/github_api/client/repos.rb on lines 423..428
lib/github_api/client/repos.rb on lines 440..445
lib/github_api/client/repos.rb on lines 462..467
lib/github_api/client/repos/branches.rb on lines 24..29
lib/github_api/client/repos/collaborators.rb on lines 24..29
lib/github_api/client/repos/downloads.rb on lines 25..30
lib/github_api/client/repos/forks.rb on lines 22..27
lib/github_api/client/repos/hooks.rb on lines 48..53
lib/github_api/client/repos/invitations.rb on lines 19..24
lib/github_api/client/repos/keys.rb on lines 24..30
lib/github_api/client/repos/releases.rb on lines 31..36
lib/github_api/client/repos/statistics.rb on lines 18..23
lib/github_api/client/repos/statistics.rb on lines 37..42
lib/github_api/client/repos/statistics.rb on lines 81..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 32.

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

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

      response = get_request("/repos/#{arguments.user}/#{arguments.repo}/branches", arguments.params)
      return response unless block_given?
Severity: Major
Found in lib/github_api/client/repos/branches.rb and 20 other locations - About 30 mins to fix
lib/github_api/client/activity/events.rb on lines 40..45
lib/github_api/client/activity/events.rb on lines 64..69
lib/github_api/client/activity/events.rb on lines 89..94
lib/github_api/client/activity/starring.rb on lines 20..25
lib/github_api/client/activity/watching.rb on lines 19..24
lib/github_api/client/issues/assignees.rb on lines 15..20
lib/github_api/client/pull_requests.rb on lines 27..33
lib/github_api/client/repos.rb on lines 423..428
lib/github_api/client/repos.rb on lines 440..445
lib/github_api/client/repos.rb on lines 462..467
lib/github_api/client/repos/collaborators.rb on lines 24..29
lib/github_api/client/repos/downloads.rb on lines 25..30
lib/github_api/client/repos/forks.rb on lines 22..27
lib/github_api/client/repos/hooks.rb on lines 48..53
lib/github_api/client/repos/invitations.rb on lines 19..24
lib/github_api/client/repos/keys.rb on lines 24..30
lib/github_api/client/repos/releases.rb on lines 31..36
lib/github_api/client/repos/statistics.rb on lines 18..23
lib/github_api/client/repos/statistics.rb on lines 37..42
lib/github_api/client/repos/statistics.rb on lines 81..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 32.

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

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

      response = get_request("/repos/#{arguments.user}/#{arguments.repo}/stats/contributors", arguments.params)
      return response unless block_given?
Severity: Major
Found in lib/github_api/client/repos/statistics.rb and 20 other locations - About 30 mins to fix
lib/github_api/client/activity/events.rb on lines 40..45
lib/github_api/client/activity/events.rb on lines 64..69
lib/github_api/client/activity/events.rb on lines 89..94
lib/github_api/client/activity/starring.rb on lines 20..25
lib/github_api/client/activity/watching.rb on lines 19..24
lib/github_api/client/issues/assignees.rb on lines 15..20
lib/github_api/client/pull_requests.rb on lines 27..33
lib/github_api/client/repos.rb on lines 423..428
lib/github_api/client/repos.rb on lines 440..445
lib/github_api/client/repos.rb on lines 462..467
lib/github_api/client/repos/branches.rb on lines 24..29
lib/github_api/client/repos/collaborators.rb on lines 24..29
lib/github_api/client/repos/downloads.rb on lines 25..30
lib/github_api/client/repos/forks.rb on lines 22..27
lib/github_api/client/repos/hooks.rb on lines 48..53
lib/github_api/client/repos/invitations.rb on lines 19..24
lib/github_api/client/repos/keys.rb on lines 24..30
lib/github_api/client/repos/releases.rb on lines 31..36
lib/github_api/client/repos/statistics.rb on lines 37..42
lib/github_api/client/repos/statistics.rb on lines 81..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 32.

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

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

      response = get_request("/repos/#{arguments.user}/#{arguments.repo}/hooks", arguments.params)
      return response unless block_given?
Severity: Major
Found in lib/github_api/client/repos/hooks.rb and 20 other locations - About 30 mins to fix
lib/github_api/client/activity/events.rb on lines 40..45
lib/github_api/client/activity/events.rb on lines 64..69
lib/github_api/client/activity/events.rb on lines 89..94
lib/github_api/client/activity/starring.rb on lines 20..25
lib/github_api/client/activity/watching.rb on lines 19..24
lib/github_api/client/issues/assignees.rb on lines 15..20
lib/github_api/client/pull_requests.rb on lines 27..33
lib/github_api/client/repos.rb on lines 423..428
lib/github_api/client/repos.rb on lines 440..445
lib/github_api/client/repos.rb on lines 462..467
lib/github_api/client/repos/branches.rb on lines 24..29
lib/github_api/client/repos/collaborators.rb on lines 24..29
lib/github_api/client/repos/downloads.rb on lines 25..30
lib/github_api/client/repos/forks.rb on lines 22..27
lib/github_api/client/repos/invitations.rb on lines 19..24
lib/github_api/client/repos/keys.rb on lines 24..30
lib/github_api/client/repos/releases.rb on lines 31..36
lib/github_api/client/repos/statistics.rb on lines 18..23
lib/github_api/client/repos/statistics.rb on lines 37..42
lib/github_api/client/repos/statistics.rb on lines 81..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 32.

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

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

      response = get_request("/repos/#{arguments.user}/#{arguments.repo}/events", arguments.params)
      return response unless block_given?
Severity: Major
Found in lib/github_api/client/activity/events.rb and 20 other locations - About 30 mins to fix
lib/github_api/client/activity/events.rb on lines 64..69
lib/github_api/client/activity/events.rb on lines 89..94
lib/github_api/client/activity/starring.rb on lines 20..25
lib/github_api/client/activity/watching.rb on lines 19..24
lib/github_api/client/issues/assignees.rb on lines 15..20
lib/github_api/client/pull_requests.rb on lines 27..33
lib/github_api/client/repos.rb on lines 423..428
lib/github_api/client/repos.rb on lines 440..445
lib/github_api/client/repos.rb on lines 462..467
lib/github_api/client/repos/branches.rb on lines 24..29
lib/github_api/client/repos/collaborators.rb on lines 24..29
lib/github_api/client/repos/downloads.rb on lines 25..30
lib/github_api/client/repos/forks.rb on lines 22..27
lib/github_api/client/repos/hooks.rb on lines 48..53
lib/github_api/client/repos/invitations.rb on lines 19..24
lib/github_api/client/repos/keys.rb on lines 24..30
lib/github_api/client/repos/releases.rb on lines 31..36
lib/github_api/client/repos/statistics.rb on lines 18..23
lib/github_api/client/repos/statistics.rb on lines 37..42
lib/github_api/client/repos/statistics.rb on lines 81..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 32.

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 starred(*args)
      arguments(args)
      params = arguments.params

      response = if (user_name = params.delete('user'))
Severity: Minor
Found in lib/github_api/client/activity/starring.rb and 1 other location - About 30 mins to fix
lib/github_api/client/activity/watching.rb on lines 43..53

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

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

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

      response = get_request("/repos/#{arguments.user}/#{arguments.repo}/languages", arguments.params)
      return response unless block_given?
Severity: Major
Found in lib/github_api/client/repos.rb and 20 other locations - About 30 mins to fix
lib/github_api/client/activity/events.rb on lines 40..45
lib/github_api/client/activity/events.rb on lines 64..69
lib/github_api/client/activity/events.rb on lines 89..94
lib/github_api/client/activity/starring.rb on lines 20..25
lib/github_api/client/activity/watching.rb on lines 19..24
lib/github_api/client/issues/assignees.rb on lines 15..20
lib/github_api/client/pull_requests.rb on lines 27..33
lib/github_api/client/repos.rb on lines 440..445
lib/github_api/client/repos.rb on lines 462..467
lib/github_api/client/repos/branches.rb on lines 24..29
lib/github_api/client/repos/collaborators.rb on lines 24..29
lib/github_api/client/repos/downloads.rb on lines 25..30
lib/github_api/client/repos/forks.rb on lines 22..27
lib/github_api/client/repos/hooks.rb on lines 48..53
lib/github_api/client/repos/invitations.rb on lines 19..24
lib/github_api/client/repos/keys.rb on lines 24..30
lib/github_api/client/repos/releases.rb on lines 31..36
lib/github_api/client/repos/statistics.rb on lines 18..23
lib/github_api/client/repos/statistics.rb on lines 37..42
lib/github_api/client/repos/statistics.rb on lines 81..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 32.

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

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

      response = get_request("/repos/#{arguments.user}/#{arguments.repo}/collaborators", arguments.params)
      return response unless block_given?
Severity: Major
Found in lib/github_api/client/repos/collaborators.rb and 20 other locations - About 30 mins to fix
lib/github_api/client/activity/events.rb on lines 40..45
lib/github_api/client/activity/events.rb on lines 64..69
lib/github_api/client/activity/events.rb on lines 89..94
lib/github_api/client/activity/starring.rb on lines 20..25
lib/github_api/client/activity/watching.rb on lines 19..24
lib/github_api/client/issues/assignees.rb on lines 15..20
lib/github_api/client/pull_requests.rb on lines 27..33
lib/github_api/client/repos.rb on lines 423..428
lib/github_api/client/repos.rb on lines 440..445
lib/github_api/client/repos.rb on lines 462..467
lib/github_api/client/repos/branches.rb on lines 24..29
lib/github_api/client/repos/downloads.rb on lines 25..30
lib/github_api/client/repos/forks.rb on lines 22..27
lib/github_api/client/repos/hooks.rb on lines 48..53
lib/github_api/client/repos/invitations.rb on lines 19..24
lib/github_api/client/repos/keys.rb on lines 24..30
lib/github_api/client/repos/releases.rb on lines 31..36
lib/github_api/client/repos/statistics.rb on lines 18..23
lib/github_api/client/repos/statistics.rb on lines 37..42
lib/github_api/client/repos/statistics.rb on lines 81..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 32.

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

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

      response = get_request("/repos/#{arguments.user}/#{arguments.repo}/stats/commit_activity", arguments.params)
      return response unless block_given?
Severity: Major
Found in lib/github_api/client/repos/statistics.rb and 20 other locations - About 30 mins to fix
lib/github_api/client/activity/events.rb on lines 40..45
lib/github_api/client/activity/events.rb on lines 64..69
lib/github_api/client/activity/events.rb on lines 89..94
lib/github_api/client/activity/starring.rb on lines 20..25
lib/github_api/client/activity/watching.rb on lines 19..24
lib/github_api/client/issues/assignees.rb on lines 15..20
lib/github_api/client/pull_requests.rb on lines 27..33
lib/github_api/client/repos.rb on lines 423..428
lib/github_api/client/repos.rb on lines 440..445
lib/github_api/client/repos.rb on lines 462..467
lib/github_api/client/repos/branches.rb on lines 24..29
lib/github_api/client/repos/collaborators.rb on lines 24..29
lib/github_api/client/repos/downloads.rb on lines 25..30
lib/github_api/client/repos/forks.rb on lines 22..27
lib/github_api/client/repos/hooks.rb on lines 48..53
lib/github_api/client/repos/invitations.rb on lines 19..24
lib/github_api/client/repos/keys.rb on lines 24..30
lib/github_api/client/repos/releases.rb on lines 31..36
lib/github_api/client/repos/statistics.rb on lines 18..23
lib/github_api/client/repos/statistics.rb on lines 81..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 32.

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

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

      response = get_request("/repos/#{arguments.user}/#{arguments.repo}/stargazers", arguments.params)
      return response unless block_given?
Severity: Major
Found in lib/github_api/client/activity/starring.rb and 20 other locations - About 30 mins to fix
lib/github_api/client/activity/events.rb on lines 40..45
lib/github_api/client/activity/events.rb on lines 64..69
lib/github_api/client/activity/events.rb on lines 89..94
lib/github_api/client/activity/watching.rb on lines 19..24
lib/github_api/client/issues/assignees.rb on lines 15..20
lib/github_api/client/pull_requests.rb on lines 27..33
lib/github_api/client/repos.rb on lines 423..428
lib/github_api/client/repos.rb on lines 440..445
lib/github_api/client/repos.rb on lines 462..467
lib/github_api/client/repos/branches.rb on lines 24..29
lib/github_api/client/repos/collaborators.rb on lines 24..29
lib/github_api/client/repos/downloads.rb on lines 25..30
lib/github_api/client/repos/forks.rb on lines 22..27
lib/github_api/client/repos/hooks.rb on lines 48..53
lib/github_api/client/repos/invitations.rb on lines 19..24
lib/github_api/client/repos/keys.rb on lines 24..30
lib/github_api/client/repos/releases.rb on lines 31..36
lib/github_api/client/repos/statistics.rb on lines 18..23
lib/github_api/client/repos/statistics.rb on lines 37..42
lib/github_api/client/repos/statistics.rb on lines 81..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 32.

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 update(*args)
      arguments(args, required: [:user, :repo, :ref]) do
        permit VALID_REF_PARAM_NAMES
        assert_required %w[ sha ]
      end
Severity: Minor
Found in lib/github_api/client/git_data/references.rb and 1 other location - About 30 mins to fix
lib/github_api/client/issues/comments.rb on lines 118..124

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

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

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

      response = get_request("/repos/#{arguments.owner}/#{arguments.repo}/assignees", arguments.params)
      return response unless block_given?
Severity: Major
Found in lib/github_api/client/issues/assignees.rb and 20 other locations - About 30 mins to fix
lib/github_api/client/activity/events.rb on lines 40..45
lib/github_api/client/activity/events.rb on lines 64..69
lib/github_api/client/activity/events.rb on lines 89..94
lib/github_api/client/activity/starring.rb on lines 20..25
lib/github_api/client/activity/watching.rb on lines 19..24
lib/github_api/client/pull_requests.rb on lines 27..33
lib/github_api/client/repos.rb on lines 423..428
lib/github_api/client/repos.rb on lines 440..445
lib/github_api/client/repos.rb on lines 462..467
lib/github_api/client/repos/branches.rb on lines 24..29
lib/github_api/client/repos/collaborators.rb on lines 24..29
lib/github_api/client/repos/downloads.rb on lines 25..30
lib/github_api/client/repos/forks.rb on lines 22..27
lib/github_api/client/repos/hooks.rb on lines 48..53
lib/github_api/client/repos/invitations.rb on lines 19..24
lib/github_api/client/repos/keys.rb on lines 24..30
lib/github_api/client/repos/releases.rb on lines 31..36
lib/github_api/client/repos/statistics.rb on lines 18..23
lib/github_api/client/repos/statistics.rb on lines 37..42
lib/github_api/client/repos/statistics.rb on lines 81..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 32.

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

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

      response = get_request("/repos/#{arguments.user}/#{arguments.repo}/tags", arguments.params)
      return response unless block_given?
Severity: Major
Found in lib/github_api/client/repos.rb and 20 other locations - About 30 mins to fix
lib/github_api/client/activity/events.rb on lines 40..45
lib/github_api/client/activity/events.rb on lines 64..69
lib/github_api/client/activity/events.rb on lines 89..94
lib/github_api/client/activity/starring.rb on lines 20..25
lib/github_api/client/activity/watching.rb on lines 19..24
lib/github_api/client/issues/assignees.rb on lines 15..20
lib/github_api/client/pull_requests.rb on lines 27..33
lib/github_api/client/repos.rb on lines 423..428
lib/github_api/client/repos.rb on lines 462..467
lib/github_api/client/repos/branches.rb on lines 24..29
lib/github_api/client/repos/collaborators.rb on lines 24..29
lib/github_api/client/repos/downloads.rb on lines 25..30
lib/github_api/client/repos/forks.rb on lines 22..27
lib/github_api/client/repos/hooks.rb on lines 48..53
lib/github_api/client/repos/invitations.rb on lines 19..24
lib/github_api/client/repos/keys.rb on lines 24..30
lib/github_api/client/repos/releases.rb on lines 31..36
lib/github_api/client/repos/statistics.rb on lines 18..23
lib/github_api/client/repos/statistics.rb on lines 37..42
lib/github_api/client/repos/statistics.rb on lines 81..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 32.

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

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

      response = get_request("/repos/#{arguments.user}/#{arguments.repo}/downloads", arguments.params)
      return response unless block_given?
Severity: Major
Found in lib/github_api/client/repos/downloads.rb and 20 other locations - About 30 mins to fix
lib/github_api/client/activity/events.rb on lines 40..45
lib/github_api/client/activity/events.rb on lines 64..69
lib/github_api/client/activity/events.rb on lines 89..94
lib/github_api/client/activity/starring.rb on lines 20..25
lib/github_api/client/activity/watching.rb on lines 19..24
lib/github_api/client/issues/assignees.rb on lines 15..20
lib/github_api/client/pull_requests.rb on lines 27..33
lib/github_api/client/repos.rb on lines 423..428
lib/github_api/client/repos.rb on lines 440..445
lib/github_api/client/repos.rb on lines 462..467
lib/github_api/client/repos/branches.rb on lines 24..29
lib/github_api/client/repos/collaborators.rb on lines 24..29
lib/github_api/client/repos/forks.rb on lines 22..27
lib/github_api/client/repos/hooks.rb on lines 48..53
lib/github_api/client/repos/invitations.rb on lines 19..24
lib/github_api/client/repos/keys.rb on lines 24..30
lib/github_api/client/repos/releases.rb on lines 31..36
lib/github_api/client/repos/statistics.rb on lines 18..23
lib/github_api/client/repos/statistics.rb on lines 37..42
lib/github_api/client/repos/statistics.rb on lines 81..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 32.

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