piotrmurach/github_cli

View on GitHub

Showing 151 of 151 total issues

Method merged has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def self.merged(user, repo, number, params, options)
Severity: Minor
Found in lib/github_cli/apis/pull_request.rb - About 35 mins to fix

    Method get has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def self.get(user, repo, id, params, options)
    Severity: Minor
    Found in lib/github_cli/apis/download.rb - About 35 mins to fix

      Method all has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def self.all(user, repo, sha, params, options)
      Severity: Minor
      Found in lib/github_cli/apis/status.rb - About 35 mins to fix

        Method get has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def self.get(user, repo, id, params, options)
        Severity: Minor
        Found in lib/github_cli/apis/milestone.rb - About 35 mins to fix

          Method delete has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def self.delete(user, repo, number, params, options)
          Severity: Minor
          Found in lib/github_cli/apis/assignee.rb - About 35 mins to fix

            Method get has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def self.get(user, repo, sha, params, options)
            Severity: Minor
            Found in lib/github_cli/apis/tree.rb - About 35 mins to fix

              Method delete has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def self.delete(owner, repo, id, params, options)
              Severity: Minor
              Found in lib/github_cli/apis/release.rb - About 35 mins to fix

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

                      def add(user, repo, number)
                        global_options = options.dup
                        params = options[:params].dup
                        params["assignees"] = options[:assignees] if options[:assignees]
                        Util.hash_without!(global_options, params.keys + ["params"])
                Severity: Major
                Found in lib/github_cli/commands/assignees.rb and 3 other locations - About 35 mins to fix
                lib/github_cli/commands/assignees.rb on lines 46..51
                lib/github_cli/commands/contents.rb on lines 23..28
                lib/github_cli/commands/trees.rb on lines 16..21

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

                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 build_output has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                      def build_output
                        if response.respond_to?(:to_ary)
                          case transform
                          when :horizontal
                            array = [flatten_hash(response[0].to_hash).keys]
                Severity: Minor
                Found in lib/github_cli/formatters/table.rb - About 35 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 config has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def config(*args)
                      name, value = args.shift, args.shift
                      config = GithubCLI.config
                
                      if !config.exist?
                Severity: Minor
                Found in lib/github_cli/cli.rb - About 35 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 update has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                      def update
                        global_options = options.dup
                        params = options[:params].dup
                        params["name"]     = options[:name]     if options.key?("name")
                        params["email"]    = options[:email]    if options.key?("email")
                Severity: Minor
                Found in lib/github_cli/commands/users.rb - About 35 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 render_cell has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                      def render_cell(field, indx)
                        width = column_widths[indx] -
                                (style.padding_left || 0) -
                                (style.padding_right || 0)
                
                
                Severity: Minor
                Found in lib/github_cli/formatters/table.rb - About 35 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 flatten_hash has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def flatten_hash(hash, prefix=nil)
                      new_hash ||= {}
                      hash.each do |key, val|
                        key =  prefix ? :"#{prefix}_#{key}" : key
                        case val
                Severity: Minor
                Found in lib/github_cli/util.rb - About 35 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 create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                      def create(user, repo)
                        global_options = options.dup
                        params = options[:params].dup
                        params["title"] = options[:title] if options.key?("title")
                        params["body"]  = options[:body]  if options.key?("body")
                Severity: Minor
                Found in lib/github_cli/commands/pull_requests.rb - About 35 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 4 locations. Consider refactoring.
                Open

                      def delete(user, repo, number)
                        global_options = options.dup
                        params = options[:params].dup
                        params["assignees"] = options[:assignees] if options[:assignees]
                        Util.hash_without!(global_options, params.keys + ["params"])
                Severity: Major
                Found in lib/github_cli/commands/assignees.rb and 3 other locations - About 35 mins to fix
                lib/github_cli/commands/assignees.rb on lines 35..40
                lib/github_cli/commands/contents.rb on lines 23..28
                lib/github_cli/commands/trees.rb on lines 16..21

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

                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(user, repo, path)
                        global_options = options.dup
                        params = options[:params].dup
                        params['ref'] = options[:ref] if options[:ref]
                        Util.hash_without!(global_options, params.keys + ['params'])
                Severity: Major
                Found in lib/github_cli/commands/contents.rb and 3 other locations - About 35 mins to fix
                lib/github_cli/commands/assignees.rb on lines 35..40
                lib/github_cli/commands/assignees.rb on lines 46..51
                lib/github_cli/commands/trees.rb on lines 16..21

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

                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(user, repo, sha)
                        global_options = options.dup
                        params = options[:params].dup
                        params["recursive"] = options[:recursive] if options[:recursive]
                        Util.hash_without!(global_options, params.keys + ["params"])
                Severity: Major
                Found in lib/github_cli/commands/trees.rb and 3 other locations - About 35 mins to fix
                lib/github_cli/commands/assignees.rb on lines 35..40
                lib/github_cli/commands/assignees.rb on lines 46..51
                lib/github_cli/commands/contents.rb on lines 23..28

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

                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 list(user, repo)
                        global_options = options.dup
                        params = options[:params].dup
                        if options[:ref]
                          params["ref"] = options[:ref]
                Severity: Minor
                Found in lib/github_cli/commands/references.rb and 2 other locations - About 35 mins to fix
                lib/github_cli/commands/contents.rb on lines 112..117
                lib/github_cli/commands/forks.rb on lines 24..29

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

                      def list(user, repo)
                        global_options = options.dup
                        params = options[:params].dup
                        params['sort'] = options[:sort] if options[:sort]
                        Util.hash_without!(global_options, params.keys + ['params'])
                Severity: Minor
                Found in lib/github_cli/commands/forks.rb and 2 other locations - About 35 mins to fix
                lib/github_cli/commands/contents.rb on lines 112..117
                lib/github_cli/commands/references.rb on lines 15..22

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

                      def readme(user, repo)
                        global_options = options.dup
                        params = options[:params].dup
                        params['ref'] = options[:ref] if options[:ref]
                        Util.hash_without!(global_options, params.keys + ['params'])
                Severity: Minor
                Found in lib/github_cli/commands/contents.rb and 2 other locations - About 35 mins to fix
                lib/github_cli/commands/forks.rb on lines 24..29
                lib/github_cli/commands/references.rb on lines 15..22

                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

                Severity
                Category
                Status
                Source
                Language