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
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")
- Read upRead up
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
- Read upRead up
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")
- Read upRead up
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")
- Read upRead up
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]
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} /, '')
- Read upRead up
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')
- Read upRead up
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
- Read upRead up
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)
- Read upRead up
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)
Method delete
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.delete(user, repo, id, params, options)
Method remove
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.remove(user, repo, collab, params, options)
Method get
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.get(user, repo, sha, params, options)
Method get
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.get(user, repo, path, params, options)
Method edit
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.edit(user, repo, id, params, options)
Method edit
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.edit(user, repo, id, params, options)
Method get
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.get(user, repo, sha, params, options)
Method add
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.add(user, repo, number, params, options)
Method merge
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.merge(user, repo, number, params, options)