Showing 27 of 29 total issues
Method parse_readme
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def parse_readme path, options = {}
@errors = [] if !@errors
name = extract_name( path )
framework = @frameworks[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
Class View
has 40 methods (exceeds 20 allowed). Consider refactoring. Open
class View
attr_accessor :enable_disqus,:enable_search,:manifest,:library,:group_name,:templates
attr_reader :root
Method process_all_rpms
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def process_all_rpms
if !File.exist? @settings.cache_dir + "/qt_source.json"
create_qt_source_cache
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 create_manifest
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_manifest name, rpm_name
qf = 'version:%{VERSION}\n'
qf += 'summary:%{SUMMARY}\n'
qf += 'homepage:%{URL}\n'
qf += 'license:%{LICENSE}\n'
Method parse_readme
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_readme path, options = {}
@errors = [] if !@errors
name = extract_name( path )
framework = @frameworks[name] || {}
File cli.rb
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Cli < Thor
default_task :global
class_option :version, :type => :boolean, :desc => "Show version"
File view.rb
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
class View
attr_accessor :enable_disqus,:enable_search,:manifest,:library,:group_name,:templates
attr_reader :root
Method create
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def create name, version=nil, release_date=nil
@@settings.manifest_path = "."
creator = Creator.new @@settings, name
if creator.is_new?
if !version && release_date || version && !release_date
- 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 read_topic_file
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def read_topic_file(file)
topics = {}
CSV.foreach(file) do |row|
row.each do |col|
lib = nil
- 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 verify
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def verify filename=nil
process_global_options options
v = Verifier.new @@settings
- 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 verify
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def verify manifest
@result = Result.new
if !manifest.filename
@result.errors.push "Unable to determine filename"
- 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_qt_source_cache
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def create_qt_source_cache
puts "Creating cache of Qt library RPMs"
sources = read_source_cache
- 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 installed
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def installed handler
packages = Hash.new
`rpmqpack`.each_line do |package|
packages[package.chomp] = true
- 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 get_package_name
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_package_name manifest
package_section = manifest.packages.openSUSE
if !package_section
STDERR.puts "No packages section in metadata"
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 verify
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def verify filename=nil
process_global_options options
v = Verifier.new @@settings
Method create
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create output_dir
assert_dir output_dir
system "cp #{view_dir}/favicon.ico #{output_dir}"
Method process_all_rpms
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_all_rpms
if !File.exist? @settings.cache_dir + "/qt_source.json"
create_qt_source_cache
end
Method verify
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def verify manifest
@result = Result.new
if !manifest.filename
@result.errors.push "Unable to determine filename"
Method parse_checkout
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def parse_checkout dir_name, options = {}
@warnings = []
@errors = []
Dir.entries( dir_name ).each do |entry|
next if entry =~ /^\./
- 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_manifest
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def create_manifest name, rpm_name
qf = 'version:%{VERSION}\n'
qf += 'summary:%{SUMMARY}\n'
qf += 'homepage:%{URL}\n'
qf += 'license:%{LICENSE}\n'
- 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"