File daedalus.rb
has 853 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'fileutils'
require 'digest/sha1'
require 'thread'
require 'dependency_grapher'
Method objects
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def objects
# This partitions the list into .o's first and .a's last. This
# is because gcc on some platforms require that static libraries
# be linked last. This is because gcc builds a list of undefined
# symbols, and then when it hits a .a, looks in the archive
- 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 out_of_date?
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def out_of_date?(ctx)
unless File.exist?(@path)
return true if @autogen_builder
raise Errno::ENOENT, "Missing #{@path}"
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 out_of_date?
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def out_of_date?(compiler)
Dir.chdir @base do
return true unless File.exist? name
@sources.each do |s|
return true unless File.exist? s.object_path
- 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
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def build(targets=[], jobs=nil)
if !targets.empty?
@programs.each do |x|
if targets.include? x.path
tasks = Tasks.new
- 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 perform_tasks
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def perform_tasks(tasks)
count = tasks.size
puts "Running #{count} tasks using #{@max} parallel threads"
start = Time.now
Method perform_tasks
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def perform_tasks(tasks)
count = tasks.size
puts "Running #{count} tasks using #{@max} parallel threads"
start = Time.now
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(cc, cxx, ldshared, ldsharedxx, logger, blueprint)
Method describe
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def describe(ctx)
if !File.exist?(object_path)
puts "#{@path}: unbuilt"
else
if @data[:sha1] != sha1(ctx)
- 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 ll_compile
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def ll_compile(ctx, source, object)
ctx.log.show "LL", source
flags = (ctx.cflags + ctx.cxxflags).join(" ").
gsub(/-O.?/, "")
- 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 detect_cpus
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.detect_cpus
if RUBY_PLATFORM =~ /windows/
return 1
else
if RUBY_PLATFORM =~ /bsd/
- 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
Avoid too many return
statements within this method. Open
return false
Method initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(cc, cxx, ldshared, ldsharedxx, logger, blueprint)
@cc = cc
@cxx = cxx
@ldshared = ldshared
@ldsharedxx = ldsharedxx
- 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 out_of_date?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def out_of_date?(ctx)
return true unless have_objects
return false unless @builder
return false if @data and @data[:sha1] == sha1
return 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"