Showing 30 of 57 total issues
Function update_entity
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
def update_entity(self, id, type = None, posestamped = None, flags = None, add_flags = [], remove_flags = [], action = None):
"""
Updates entity
:param id: entity id
:param type: entity type
- 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
File arms.py
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
#! /usr/bin/env python
import rospy
import std_msgs.msg
import tf_server
File mockbot.py
has 280 lines of code (exceeds 250 allowed). Consider refactoring. Open
#! /usr/bin/env python
import random
from collections import defaultdict
import geometry_msgs
Function indent
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def indent(self, elem, level=0):
i = "\n" + level*" "
if len(elem):
if not elem.text or not elem.text.strip():
elem.text = i + " "
- 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 _send_joint_trajectory
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def _send_joint_trajectory(self, joints_references, timeout=rospy.Duration(5), joint_names = None):
'''
Low level method that sends a array of joint references to the arm.
If timeout is defined, it will wait for timeout*len(joints_reference) seconds for the
- 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 send_goal
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_goal(self, px, py, pz, roll, pitch, yaw,
Function _send_goal
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _send_goal(self, torso_pos, timeout=0.0, tolerance = []):
rospy.logdebug("Send torso goal {0}, timeout = {1}".format(torso_pos, timeout))
if len(torso_pos) != len(self.joint_names):
rospy.logwarn('Length of desired torso pos {0} does not correspond with number of joints {1}'.format(len(torso_pos), len(self.joint_names)))
- 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 PoseStamped
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def PoseStamped(x=0, y=0, z=0, phi=0,
Function speak
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def speak(self, sentence, language=None, personality=None, voice=None, mood=None, block=True, replace={"_":" "}):
"""
Send a sentence to the text to speech module.
You can set language, personality, voice and mood for the Phiips TTS.
When block=False, this method returns immediatly.
- 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 close
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def close(self):
try:
self.head.close()
except: pass
- 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 __init__
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, robot_name):
self._robot_name = robot_name
self.rosbag = False
rospy.loginfo("Nav_analyser: Bagging = {0}".format(self.rosbag))
Function _setHeadReferenceGoal
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def _setHeadReferenceGoal(self, goal_type, pan_vel, tilt_vel, end_time, point_stamped=PointStamped(), pan=0, tilt=0, timeout=0):
Function Pose
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def Pose(x=0, y=0, z=0, phi=0, roll=0, pitch=0, yaw=0):
Function speak
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def speak(self, sentence, language=None, personality=None, voice=None, mood=None, block=True, replace={"_":" "}):
Function Quaternion
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def Quaternion(x=0, y=0, z=0, w=0, roll=0, pitch=0, yaw=0):
Function update_entity
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_entity(self, id, type = None, posestamped = None, flags = None, add_flags = [], remove_flags = [], action = None):
Function PointStamped
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def PointStamped(x=0, y=0, z=0, frame_id="/map", stamp=None, point=None):
Avoid deeply nested control flow statements. Open
if not first:
json_entity += ','
json_entity += '{"%s":"%s"}' % (k,v)
Consider simplifying this complex logical expression. Open
if x or y or z or w:
return gm.Quaternion(x, y, z, w)
elif roll or pitch or yaw:
quat_parts = tf.transformations.quaternion_from_euler(roll, pitch, yaw)
quat = Quaternion(*quat_parts)
Function look_at_point
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def look_at_point(self, point_stamped, end_time=0, pan_vel=1.0, tilt_vel=1.0, timeout=0):