Showing 10 of 130 total issues
Method client_kill
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def client_kill(opts_or_addr = {})
if opts_or_addr.is_a?(String)
run(:CLIENT, :KILL, opts_or_addr)
else
args = [:CLIENT, :KILL]
- 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 parse
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse(io)
line = io.gets(TERMINATOR)
case line[0]
when SIMPLE_STRING
Method parse
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def parse(io)
line = io.gets(TERMINATOR)
case line[0]
when SIMPLE_STRING
- 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 georadius
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def georadius(key, longitude, latitude, radius, unit, opts = {})
Method georadiusbymember
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def georadiusbymember(key, member, radius, unit, opts = {})
Method common_range
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def common_range(command_name, key, start, stop, opts)
Method common_rangebyscore
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def common_rangebyscore(command_name, key, min, max, opts)
Method common_store
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def common_store(command_name, destination, numkeys, *keys, **opts)
Method common_rangebylex
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def common_rangebylex(command_name, key, min, max, opts)
Method add_georadius_opts!
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def add_georadius_opts!(args, opts)
args << :WITHCOORD if opts[:withcoord]
args << :WITHDIST if opts[:withdist]
args << :WITHHASH if opts[:withhash]
- 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"