piotrmurach/github

View on GitHub

Showing 152 of 152 total issues

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

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

      response = get_request("/repos/#{arguments.user}/#{arguments.repo}/teams", 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 440..445
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 network(*args)
      arguments(args, required: [:user, :repo])

      response = get_request("/networks/#{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 40..45
lib/github_api/client/activity/events.rb on lines 64..69
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 watched(*args)
      arguments(args)
      params = arguments.params

      response = if (user_name = params.delete('user'))
Severity: Minor
Found in lib/github_api/client/activity/watching.rb and 1 other location - About 30 mins to fix
lib/github_api/client/activity/starring.rb on lines 53..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 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}/invitations", arguments.params)
      return response unless block_given?
Severity: Major
Found in lib/github_api/client/repos/invitations.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/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 edit(*args)
      arguments(args, required: [:user, :repo, :id]) do
        permit VALID_ISSUE_COMMENT_PARAM_NAME
        assert_required %w[ body ]
      end
Severity: Minor
Found in lib/github_api/client/issues/comments.rb and 1 other location - About 30 mins to fix
lib/github_api/client/git_data/references.rb on lines 113..119

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 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}/keys",
                             arguments.params)
Severity: Major
Found in lib/github_api/client/repos/keys.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/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}/forks", arguments.params)
      return response unless block_given?
Severity: Major
Found in lib/github_api/client/repos/forks.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/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 issue(*args)
      arguments(args, required: [:user, :repo])

      response = get_request("/repos/#{arguments.user}/#{arguments.repo}/issues/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 40..45
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 21 locations. Consider refactoring.
Open

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

      response = get_request("/repos/#{arguments.user}/#{arguments.repo}/stats/punch_card", 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 37..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 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}/pulls",
                             arguments.params)
Severity: Major
Found in lib/github_api/client/pull_requests.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/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 list(*args)
      params = arguments(args).params

      response = if user_name = arguments.remaining.first
        get_request("/users/#{user_name}/followers", params)
Severity: Minor
Found in lib/github_api/client/users/followers.rb and 1 other location - About 25 mins to fix
lib/github_api/client/users/followers.rb on lines 50..59

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

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

      response = if user_name = arguments.remaining.first
        get_request("/users/#{user_name}/following", params)
Severity: Minor
Found in lib/github_api/client/users/followers.rb and 1 other location - About 25 mins to fix
lib/github_api/client/users/followers.rb on lines 23..32

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

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

Method namespace has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def self.namespace(*names)
      options = names.last.is_a?(Hash) ? names.pop : {}
      names   = names.map(&:to_sym)
      name    = names.pop

Severity: Minor
Found in lib/github_api/api.rb - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method assert_presence_of has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def assert_presence_of(*args)
        hash = args.last.is_a?(::Hash) ? args.pop : {}

        errors = hash.select { |key, val| val.to_s.empty? }
        raise Github::Error::Validations.new(errors) unless errors.empty?
Severity: Minor
Found in lib/github_api/validations/presence.rb - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method check has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def check(*args)
      raise_authentication_error unless authenticated?
      params = arguments(args, required: [:client_id, :access_token]).params

      if arguments.client_id
Severity: Minor
Found in lib/github_api/client/authorizations/app.rb - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method merge_default has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def merge_default(defaults)
      if defaults && !defaults.empty?
        defaults.each do |key, value|
          self[key] = value unless self.key?(key)
        end
Severity: Minor
Found in lib/github_api/params_hash.rb - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

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

      get_request("/user/starred/#{arguments.user}/#{arguments.repo}", arguments.params)
      true
Severity: Minor
Found in lib/github_api/client/activity/starring.rb and 1 other location - About 25 mins to fix
lib/github_api/client/activity/watching.rb on lines 133..139

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

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

      get_request("/user/subscriptions/#{arguments.user}/#{arguments.repo}", arguments.params)
      true
Severity: Minor
Found in lib/github_api/client/activity/watching.rb and 1 other location - About 25 mins to fix
lib/github_api/client/activity/starring.rb on lines 81..87

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

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

    def move(*args)
      arguments(args, required: [:card_id]) do
        assert_required REQUIRED_MOVE_CARD_PARAMS
      end
      params = arguments.params
Severity: Minor
Found in lib/github_api/client/projects/cards.rb and 2 other locations - About 25 mins to fix
lib/github_api/client/projects/columns.rb on lines 65..73
lib/github_api/client/projects/columns.rb on lines 135..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 29.

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

    def move(*args)
      arguments(args, required: [:column_id]) do
        assert_required REQUIRED_MOVE_COLUMN_PARAMS
      end
      params = arguments.params
Severity: Minor
Found in lib/github_api/client/projects/columns.rb and 2 other locations - About 25 mins to fix
lib/github_api/client/projects/cards.rb on lines 147..155
lib/github_api/client/projects/columns.rb on lines 65..73

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

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