Showing 9 of 28 total issues
Class Action
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class Action
attr_reader :controller
def initialize(controller)
@controller = controller
Method join
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def join(*names)
return '' if names.empty?
names.filter!(&:present?)
names.map! do |name|
- 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
Function Playground
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Playground() {
const [value, setValue] = React.useState(exampleGame);
const [url, setURL] = React.useState(defaultURL);
const router = useRouter();
const onHeaderClick = () => {
Class Window
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Window < ::Carbuncle::GUI::Container
attr_reader :title, :rect, :scroll
attr_writer :id
attr_accessor :border, :movable, :scalable, :closable, :minimizable,
:disable_scrollbar, :show_title, :auto_scrollbar,
Method join
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def join(*names)
return '' if names.empty?
names.filter!(&:present?)
names.map! do |name|
Method readlines
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def readlines(arg1 = nil, arg2 = nil)
limit, sep = -1, "\n"
if arg2
limit = arg2
sep = arg1 || sep
- 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 assign_uniform
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def assign_uniform(name, value)
symbol = name.to_sym
klass = @uniform_types[symbol]
unless @uniform_types.key?(symbol)
raise ArgumentError, "Uniform '#{name}' does not exists on shader."
- 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 update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update(dt)
return unless running?
current_animation = @animations[current]
@time += dt
- 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 descendants
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def descendants
descendants = []
ObjectSpace.each_object(singleton_class) do |k|
next if k.singleton_class?
- 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"