Showing 3 of 6 total issues
Method handle_joystick_0
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def handle_joystick_0 caller, data
thrust_scale = 1.46
yaw_scale = 0.000191753
degrade = 700
@power = 0 if @power.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 handle_joystick_1
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def handle_joystick_1 caller, data
deg_scale = 0.00091
if data[:y] < 0
drone.forward(data[:y].abs * deg_scale)
- 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 connect
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def connect
require 'crubyflie' unless defined?(::Crubyflie)
@crazyflie = ::Crubyflie::Crazyflie.new('/tmp/test')
source = additional_params[:source] || ""
if source.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"