Method requires_redmine
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def requires_redmine(arg)
arg = {:version_or_higher => arg} unless arg.is_a?(Hash)
arg.assert_valid_keys(:version, :version_or_higher)
current = Redmine::VERSION.to_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
Class Plugin
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
class Plugin
# Absolute path to the directory where plugins are located
cattr_accessor :directory
self.directory = PluginLoader.directory
File plugin.rb
has 296 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Redmine
# Exception raised when a plugin cannot be found given its id.
class PluginNotFound < StandardError; end
Method requires_redmine_plugin
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def requires_redmine_plugin(plugin_name, arg)
arg = {:version_or_higher => arg} unless arg.is_a?(Hash)
arg.assert_valid_keys(:version, :version_or_higher)
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 requires_redmine
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def requires_redmine(arg)
arg = {:version_or_higher => arg} unless arg.is_a?(Hash)
arg.assert_valid_keys(:version, :version_or_higher)
current = Redmine::VERSION.to_a
Method requires_redmine_plugin
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def requires_redmine_plugin(plugin_name, arg)
arg = {:version_or_higher => arg} unless arg.is_a?(Hash)
arg.assert_valid_keys(:version, :version_or_higher)
begin
Method register
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.register(id, &block)
p = new(id)
p.instance_eval(&block)
# Set a default name if it was not provided during registration
Method register
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def self.register(id, &block)
p = new(id)
p.instance_eval(&block)
# Set a default name if it was not provided during registration
- 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"