Showing 119 of 411 total issues
Function get_view
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_view(self, index, copy=False):
view = self.create_new_instance(self)
if copy:
view._states = np.empty_like(self._states)
- 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 mouse_move
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def mouse_move(self, window, x_pos, y_pos):
"""
Mouse mode callback for glfw.
Args:
- 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 _step
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _step(self, render, record, mask):
"""
Single step.
Args:
- 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 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, gamma=0.99, horizon=500, n_agents=1, env_noise=False, obs_noise=False, obs_delay=False,
torque_control=True, step_action_function=None, timestep=1 / 240., n_intermediate_steps=1,
debug_gui=False, table_boundary_terminate=False):
"""
Constructor.
Function __init__
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, gamma=0.99, horizon=120, env_noise=False, obs_noise=False, timestep=1 / 240.,
n_intermediate_steps=1, **viewer_params):
"""
Constructor.
Function _set_camera
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _set_camera(self):
"""
Sets the camera mode to the current camera mode target. Allowed camera
modes are "follow" in which the model is tracked, "static" that is a static
camera at the default camera positon, and "top_static" that is a static
- 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 convert
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def convert(cls, *arrays, to=None, backend=None):
if to is None:
to = cls.get_backend_name()
if backend is None:
backend = ArrayBackend.get_array_backend_from(arrays[0])
- 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 step
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def step(self, action):
total_reward = 0.
for i in range(self._skip):
obs, reward, absorbing, _, info = self.env.step(action)
if i == self._skip - 2:
- 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 _process_actuation_spec
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _process_actuation_spec(self, actuation_spec):
for name, mode in actuation_spec:
if name in self.joint_map:
data = self.joint_map[name] + (mode,)
self.action_data.append(data)
- 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 predict
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def predict(self, *z):
"""
Predict the output of the table given an input.
Args:
- 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 reset
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def reset(self, state=None):
if state is None:
if self.random_init:
rand_state = np.random.uniform(-3, 3, size=self.A.shape[0])
self._state = self._bound(rand_state, self.info.observation_space.low, self.info.observation_space.high)
- 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 compute_gae
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def compute_gae(V, s, pi_h, ss, pi_hn, lengths, r, absorbing, last, gamma, lam):
"""
Function to compute Generalized Advantage Estimation (GAE)
and new value function target over a dataset.
- 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 compute_indexes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def compute_indexes(self, *args):
x = self._concatenate(args)
y = list()
- 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 forward
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def forward(self, state, action=None, get_quantiles=False):
features = self._phi(state)
a_quant = [self._quant[i](features) for i in range(self._n_output)]
a_quant = torch.stack(a_quant, dim=1)
- 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 compute_gae
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def compute_gae(V, s, ss, r, absorbing, last, gamma, lam):
"""
Function to compute Generalized Advantage Estimation (GAE)
and new value function target over a dataset.
- 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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, config_file, horizon=None, gamma=0.99, is_discrete=False,
width=None, height=None, debug_gui=False, verbose=False):
"""
Constructor.
- 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 _set_horizon
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _set_horizon(env, horizon):
while not hasattr(env, '_max_episode_steps') and env.env != env.unwrapped:
env = env.env
- 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 get_state
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_state(self, data, name, o_type):
"""
Get a single observation from data, given it's name and observation type. The ObservationType documentation
describes the different returns in detail
"""
- 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 get_view
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_view(self, index, copy=False):
view = self.create_new_instance(self)
if isinstance(index, (int, slice)):
view._dataset = self._dataset[index]
- 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
Consider simplifying this complex logical expression. Open
if obs_type is PyBulletObservationType.BODY_POS \
or obs_type is PyBulletObservationType.BODY_LIN_VEL \
or obs_type is PyBulletObservationType.BODY_ANG_VEL:
model_id = self.model_map[name]
if obs_type is PyBulletObservationType.BODY_POS: