Showing 67 of 67 total issues
Class Configuration
has 42 methods (exceeds 20 allowed). Consider refactoring. Open
class Configuration
include Singleton
class << self
Class API
has 40 methods (exceeds 20 allowed). Consider refactoring. Open
class API
include Vedeu::Common
# @param (see #initialize)
Class DSL
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class DSL
include Vedeu::DSL
include Vedeu::DSL::Border
include Vedeu::DSL::Presentation
Class Cursor
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Cursor
include Vedeu::Repositories::Model
include Vedeu::Toggleable
extend Forwardable
Class Document
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class Document
include Vedeu::Repositories::Defaults
include Vedeu::Repositories::Model
extend Forwardable
Class Alignment
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Alignment
include Vedeu::Common
# @!attribute [r] value
Class Attributes
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Attributes
include Vedeu::Common
# @param (see #initialize)
Class Move
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Move
include Vedeu::Repositories::Defaults
extend Forwardable
Method coerce
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def coerce(collection = [], parent = nil, name = nil)
if collection.is_a?(Vedeu::Views::Streams)
collection
elsif array?(collection)
- 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 coerce
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def coerce(collection = [], parent = nil, name = nil)
if collection.is_a?(Vedeu::Views::Chars)
collection
elsif array?(collection)
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
module Colours
# The class represents one half (the other, can be found at
# {Vedeu::Colours::Foreground}) of a terminal colour escape
# sequence.
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 60.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method coerce
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def coerce(collection = [], parent = nil, name = nil)
if collection.is_a?(Vedeu::Views::Lines)
collection
elsif collection.is_a?(Vedeu::Views::Streams)
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
module Colours
# The class represents one half (the other, can be found at
# {Vedeu::Colours::Background}) of a terminal colour escape
# sequence.
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 60.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method attributes
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def attributes
{
client: client,
height: @height.is_a?(Proc) ? @height.call : @height,
horizontal_alignment: horizontal_alignment,
- 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 defaults
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def defaults
{
background: :default,
base_path: base_path,
colour_mode: detect_colour_mode,
Method coerce
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def coerce
if coerced?
value
elsif hash?(value)
- 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
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def read
Vedeu.log(type: :input, message: "Waiting for user input...\n")
if raw_mode?
Vedeu.trigger(:_keypress_, keypress)
- 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 coerce
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def coerce(collection = [], parent = nil, name = nil)
if collection.is_a?(Vedeu::Views::Streams)
collection
elsif array?(collection)
Method parse
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def parse
lines_collection = Vedeu::Views::Lines.new
lines.each do |line|
line_object = Vedeu::Views::Line.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 loggable?
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def loggable?(type)
return false unless log?
return false unless Vedeu::LOG_TYPES_KEYS.include?(type)
return true if log_only.empty? && log_except.empty?
- 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"