piotrmurach/github_cli

View on GitHub

Showing 75 of 151 total issues

File cli.rb has 261 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'tty-editor'

require_relative 'vendor'

module GithubCLI
Severity: Minor
Found in lib/github_cli/cli.rb - About 2 hrs to fix

    Method list has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

          def list
            global_options = options.dup
            params = options[:params].dup
            params["org"]       = options[:org]       if options.key?("org")
            params["user"]      = options[:user]      if options.key?("user")
    Severity: Minor
    Found in lib/github_cli/commands/issues.rb - About 2 hrs 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 15 (exceeds 5 allowed). Consider refactoring.
    Open

          def create(args)
            global_options = options.dup
            params = options[:params].dup
            org, params["name"] = Arguments.new(args).parse
            params["org"]                = org if org
    Severity: Minor
    Found in lib/github_cli/commands/repositories.rb - About 1 hr 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 edit has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

          def edit(org)
            global_options = options.dup
            params = options[:params].dup
            params["billing_email"] = options[:billing_email] if options.key?("billing_email")
            params["blog"] = options[:blog] if options.key?("blog")
    Severity: Minor
    Found in lib/github_cli/commands/organizations.rb - About 1 hr 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 edit has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

          def edit(user, repo, name)
            global_options = options.dup
            params = options[:params].dup
            params["name"] = name
            params["description"]        = options["desc"] if options.key?("desc")
    Severity: Minor
    Found in lib/github_cli/commands/repositories.rb - About 1 hr 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 build_output has 29 lines of code (exceeds 25 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 1 hr to fix

      Method printable_commands has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def printable_commands(all = true, subcommand = false)
            (all ? all_commands : commands).map do |_, command|
              next if command.hidden?
              item = []
              item << banner(command, false, subcommand).gsub(/#{basename} /, '')
      Severity: Minor
      Found in lib/github_cli/thor_ext.rb - About 55 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 configure has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def configure(options = {})
            api    = Github.new
            config = GithubCLI.config
      
            ssl      = config.fetch('core.ssl')
      Severity: Minor
      Found in lib/github_cli/api.rb - About 55 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 format has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

            def format
              output = []
      
              case response
              when Array
      Severity: Minor
      Found in lib/github_cli/formatters/table.rb - About 45 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 all has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def self.all
            commands = []
            Thor::Base.subclasses.each do |klass|
              namespace = extract_namespace(klass)
              next unless is_api_command?(namespace)
      Severity: Minor
      Found in lib/github_cli/command.rb - About 45 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 delete has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

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

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

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

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

              def self.remove(user, repo, collab, params, options)
          Severity: Minor
          Found in lib/github_cli/apis/collaborator.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/tag.rb - About 35 mins to fix

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

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

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

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

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

                      def self.edit(user, repo, id, params, options)
                  Severity: Minor
                  Found in lib/github_cli/apis/hook.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/commit.rb - About 35 mins to fix

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

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

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

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