Showing 15 of 17 total issues
Class Global
has 38 methods (exceeds 20 allowed). Consider refactoring. Open
class Global
attr_accessor :config, :path, :servers, :plugins, :themes, :layouts
def initialize(task, from_command=false)
Class Server
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class Server
attr_accessor :task, :name, :path, :config, :host, :port, :database, :context
# Initialize server config
File global.rb
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Marv
class Global
attr_accessor :config, :path, :servers, :plugins, :themes, :layouts
Method init_sprockets
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def init_sprockets
if ExecJS::Runtimes.runtimes.none?(&:available?)
@task.say_error "No execjs runtime found! Aborting..."
abort
end
Method project_contents
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.project_contents
assets_path = @project.assets_path.gsub(/#{@project.root}\//, '')
source_path = @project.source_path.gsub(/#{@project.root}\//, '')
config_file = @project.config_file.gsub(/#{@project.root}\//, '')
Method list
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def list(dir='all')
servers = Marv::Global.new(self).servers
if dir == 'all'
say_info "Available marv servers:", true
Method create_project_dirs
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def create_project_dirs
::Dir.glob(::File.join(@layout, '**', '*')).each do |dir|
if ::File.directory?(dir)
# Get source and target files
source_dir = dir.gsub(@layout, '')
- 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 list
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def list(dir='all')
servers = Marv::Global.new(self).servers
if dir == 'all'
say_info "Available marv servers:", 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 init_sprockets
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def init_sprockets
if ExecJS::Runtimes.runtimes.none?(&:available?)
@task.say_error "No execjs runtime found! Aborting..."
abort
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 link_target
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def link_target
target = link_to_server unless link_to_server.nil?
target = link_to_folder unless link_to_folder.nil?
target = link_global unless link_global.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 build_asset_file
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def build_asset_file(asset)
destination = ::File.join(@project.build_path, asset)
@task.shell.mute do
sprocket = @sprockets.find_asset(asset.last)
- 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 stop
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def stop(dir)
unless dir == 'all'
server = Marv::Server::Server.new(self, dir)
action = Marv::Server::Actions.new(server)
action.stop
- 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 generate_config
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def generate_config(from_command=false)
if from_command
::File.exists?(config_file) ? reconfigure : configure(from_command)
else
configure unless ::File.exists?(config_file)
- 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 stop
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def stop(message=true)
abort_noexist
pid_file = ::File.join(@path, 'php.pid')
begin
- 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 _prompt
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _prompt(ending_char)
proc do |target_self, nest_level, pry|
history = pry.input_ring.size
process = ::Guard.listener.paused? ? _colorize("pause", :yellow) : _colorize("marv", :green)
level = ":#{nest_level}" unless nest_level.zero?
- 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"