Showing 25 of 31 total issues
Class SSH
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
class SSH < Actor
attr_accessor :options #:nodoc:
class SSHCommandFailure < StandardError #:nodoc:
attr_accessor :details
Class Package
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
class Package #:nodoc:
attr_accessor :name, :provides, :verifications
attr_internal :args, :opts
cattr_reader :installer_methods
@@installer_methods = []
Class Installer
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Installer
include Sprinkle::Attributes
include Sprinkle::Sudo
delegate :version, :to => :package
Class Source
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Source < Installer
attr_accessor :source #:nodoc:
api do
def source(source, options = {}, &block)
Method setup_rendering
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def setup_rendering
ActiveSupport::Deprecation.warn("transfer :render is depreciated, please use the `file` installer now.")
ActiveSupport::Deprecation.warn("transfer :render will be removed from Sprinkle v0.8")
if @options[:render]
raise "Incompatible combination of options :render and :tarball" if tarball?
- 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 channel_runner
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def channel_runner(session, command) #:nodoc:
session.open_channel do |channel|
channel.on_data do |ch, data|
@log_recorder.log :out, data
logger.debug yellow("[#{session.host}] stdout said-->\n#{data}\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"
Further reading
Method initialize
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def initialize(parent, source, destination, options = {}, &block) #:nodoc:
options.reverse_merge! :recursive => true
@source = source # Original source
@sourcepath = source # What the actor will transfer (may be the same as @source)
- 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 process_with_transfer
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def process_with_transfer(name, commands, roles, opts ={}) #:nodoc:
raise "cant do non recursive file transfers, sorry" if opts[:recursive] == false
commands = commands.map{|x| x == :TRANSFER ? x : "sudo #{x}" } if sudo?
i = commands.index(:TRANSFER)
before = commands.first(i).join(" && ")
- 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 channel_runner
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def channel_runner(session, command) #:nodoc:
session.open_channel do |channel|
channel.on_data do |ch, data|
@log_recorder.log :out, data
logger.debug yellow("[#{session.host}] stdout said-->\n#{data}\n")
Method process
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def process(roles, pre = false) #:nodoc:
description = @description.empty? ? " (#{@package.name})" : @description
if logger.debug?
logger.debug "#{@package.name}#{description} verification sequence: #{@commands.join('; ')} for roles: #{roles}\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"
Further reading
Method process
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def process(name, commands, roles, opts = {}) #:nodoc:
inst=@installer
@log_recorder = log_recorder = Sprinkle::Utility::LogRecorder.new
commands = commands.map {|x| rewrite_command(x)}
define_task(name, roles) 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 multi_attributes
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def multi_attributes(*list)
list.each do |a|
define_method a do |*val|
val = val.try(:first)
return @options[a] unless val
- 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 prepare_commands
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def prepare_commands(commands) #:nodoc:
return commands unless sudo?
commands.map do |command|
next command if command.is_a?(Symbol) || command.is_a?(Sprinkle::Commands::Command)
command.match(/^#{sudo_command}/) ? command : "#{sudo_command} #{command}"
- 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 attributes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def attributes(*list)
list.each do |a|
define_method a do |*val|
val=nil if val.empty?
val ? @options[a] = val.first : @options[a] || read_from_package(a)
- 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(parent, regex, text, path, options={}, &block) #:nodoc:
Method tree_for_packages
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def tree_for_packages(packages, opts={}, &block)
depth = opts[:depth]
tree = []
packages.each do |dep, config|
package = PACKAGES.find_all(dep, config)
- 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 replace_text
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def replace_text(regex, text, path, options={}, &block)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(parent, source, destination, options = {}, &block) #:nodoc:
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(parent, text, path, options={}, &block) #:nodoc:
Method initialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def initialize(&block) #:nodoc:
@installer = nil
@config = ::Capistrano::Configuration.new
@config.logger.level = Sprinkle::OPTIONS[:verbose] ? ::Capistrano::Logger::INFO : ::Capistrano::Logger::IMPORTANT
@config.set(:password) { ::Capistrano::CLI.password_prompt }
- 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"