Function tryRerouting
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
tryRerouting() {
let motionService = this;
let pfTarget = this._targetQueue.getTargetBack();
if (pfTarget !== null) {
- 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 _onObstacleDetected
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
_onObstacleDetected(params) {
if (this._targetQueue.getTargetFront() === null) return;
let hazardAngle = (this.motionDriver.getDirection() === MotionDriver.DIRECTION_FORWARD) ?
this.config.hazardAngleFront : this.config.hazardAngleBack;
- 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 straight
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
straight(millimeters, params) {
// Update last moving directiObstacle is too long in front of roboton
if (this.motionDriver.getDirection() !== MotionDriver.DIRECTION_UNDEFINED) {
this._lastDirection = this.motionDriver.getDirection();
}
- 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 _goSingleTarget
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_goSingleTarget(point, params) {
Mep.Log.debug(TAG, 'Simple target go', point);
this._paused = false;
// Set speed
- 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 _onPathObstacleDetected
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_onPathObstacleDetected(detected, friend) {
if (detected === true) {
let target = this._targetQueue.getTargetFront();
let timeout = (friend === true) ? target.getParams().friend : target.getParams().obstacle;
- 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
TODO found Open
TODO: Try to redesign a path in runtime
- Exclude checks