Showing 22 of 35 total issues
Method define
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
def define
task :version_required do
if jeweler.expects_version_file? && !jeweler.version_file_exist?
abort "Expected VERSION or VERSION.yml to exist. Use 'rake version:write' to create an initial one."
end
Method initialize
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(args)
super()
@orig_args = args.clone
self[:testing_framework] = :shoulda
Class Jeweler
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Jeweler
require 'jeweler/errors'
require 'rubygems/user_interaction'
require 'rubygems/package'
Method set_jeweler_defaults
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def set_jeweler_defaults(base_dir, git_base_dir = nil)
base_dir = File.expand_path(base_dir)
git_base_dir = if git_base_dir
File.expand_path(git_base_dir)
else
- 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 initialize
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(options = {})
self.options = options
extracted_directory = nil
self.project_name = options[:project_name]
Method initialize
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def initialize(options = {})
self.options = options
extracted_directory = nil
self.project_name = options[:project_name]
- 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 define
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def define
task :version_required do
if jeweler.expects_version_file? && !jeweler.version_file_exist?
abort "Expected VERSION or VERSION.yml to exist. Use 'rake version:write' to create an initial one."
end
- 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 set_jeweler_defaults
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_jeweler_defaults(base_dir, git_base_dir = nil)
base_dir = File.expand_path(base_dir)
git_base_dir = if git_base_dir
File.expand_path(git_base_dir)
else
Method run!
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run!(*arguments)
options = build_options(arguments)
if options[:invalid_argument]
$stderr.puts options[:invalid_argument]
Method find_missing_dependencies
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def find_missing_dependencies
if Gem::Specification.respond_to?(:find_by_name)
dependencies.select do |dependency|
begin
spec = Gem::Specification.find_by_name(dependency.name, *dependency.requirement.as_list)
- 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 define
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def define
namespace :rubyforge do
namespace :release do
desc 'Release the current gem version to RubyForge.'
task :gem do
Method create_files
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_files
if File.exist?(target_dir) || File.directory?(target_dir)
raise FileInTheWay, "The directory #{target_dir} already exists, aborting. Maybe move it out of the way before continuing?"
else
FileUtils.mkdir target_dir
Method define
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def define
namespace :rubyforge do
namespace :release do
desc 'Release the current gem version to RubyForge.'
task :gem do
- 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_version_control
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create_version_control
Dir.chdir(target_dir) do
begin
@repo = Git.init
rescue Git::GitExecuteError => e
- 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 write_version
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def write_version(major, minor, patch, build, _options = {})
Avoid too many return
statements within this method. Open
return 1
Avoid too many return
statements within this method. Open
return 1
Avoid too many return
statements within this method. Open
return 1
Avoid too many return
statements within this method. Open
return 1
Method create_files
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_files
if File.exist?(target_dir) || File.directory?(target_dir)
raise FileInTheWay, "The directory #{target_dir} already exists, aborting. Maybe move it out of the way before continuing?"
else
FileUtils.mkdir target_dir
- 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"