Showing 224 of 1,036 total issues
Function site_data_dir
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def site_data_dir(appname=None, appauthor=None, version=None, multipath=False):
r"""Return full path to the user-shared data dir for this application.
"appname" is the name of application.
If None, just the system directory is returned.
- Read upRead up
- Create a ticketCreate a ticket
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 map_locations_to
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def map_locations_to(self, dst):
from dallinger.config import initialize_experiment_package
initialize_experiment_package(dst)
from dallinger.experiment import load
- Read upRead up
- Create a ticketCreate a ticket
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 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
ScribeDallingerTracker.prototype.init = function() {
var config = this.config;
var getNodeDescriptor = function(node) {
return {
id: node.id,
- Create a ticketCreate a ticket
File __init__.py
has 791 lines of code (exceeds 750 allowed). Consider refactoring. Open
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""The Dallinger command-line utility."""
- Create a ticketCreate a ticket
Function is_connected
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def is_connected(self, whom, direction="to", failed=None):
"""Check whether this node is connected [to/from] whom.
whom can be a list of nodes or a single node.
direction can be "to" (default), "from", "both" or "either".
- Read upRead up
- Create a ticketCreate a ticket
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 update
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Game.prototype.update = function(dt) {
var x, y;
if (atom.input.pressed('move_left')) {
if (this.dir !== "right") {
this.newdir = "left";
- Create a ticketCreate a ticket
Function struct_to_html
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def struct_to_html(data):
parts = ["<ul>"]
if isinstance(data, (list, tuple)):
for i in data:
parts.append(struct_to_html(i))
- Read upRead up
- Create a ticketCreate a ticket
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 listen
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
KeyboardInputManager.prototype.listen = function () {
var self = this;
var map = {
38: 0, // Up
- Create a ticketCreate a ticket
Function node_transmit
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def node_transmit(node_id):
"""Transmit to another node.
The sender's node id must be specified in the url.
- Read upRead up
- Create a ticketCreate a ticket
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 user_cache_dir
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def user_cache_dir(appname=None, appauthor=None, version=None, opinion=True):
r"""Return full path to the user-specific cache dir for this application.
"appname" is the name of application.
If None, just the system directory is returned.
- Read upRead up
- Create a ticketCreate a ticket
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 user_data_dir
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def user_data_dir(appname=None, appauthor=None, version=None, roaming=False):
r"""Return full path to the user-specific data dir for this application.
"appname" is the name of application.
If None, just the system directory is returned.
- Read upRead up
- Create a ticketCreate a ticket
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 run_and_echo
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def run_and_echo(self, cmd): # pragma: no cover
"""Execute the given command on the remote host and prints its output
while it runs. Allows quitting by pressing the letter "q".
Buffers lines to prevent flickering.
- Read upRead up
- Create a ticketCreate a ticket
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 transmit
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def transmit(self, what=None, to_whom=None):
"""Transmit one or more infos from one node to another.
"what" dictates which infos are sent, it can be:
(1) None (in which case the node's _what method is called).
- Read upRead up
- Create a ticketCreate a ticket
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 load
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def load():
"""Load the active experiment."""
first_err = second_err = None
initialize_experiment_package(os.getcwd())
try:
- Read upRead up
- Create a ticketCreate a ticket
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 create_participant
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def create_participant(worker_id, hit_id, assignment_id, mode, entry_information=None):
"""Create a participant.
This route is hit early on. Any nodes the participant creates will be
defined in reference to the participant object. You must specify the
- Read upRead up
- Create a ticketCreate a ticket
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
Recruiter
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class Recruiter(object):
"""The base recruiter."""
nickname = None
external_submission_url = None # MTurkRecruiter, for one, overides this
- Create a ticketCreate a ticket
Function launch
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def launch():
"""Launch the experiment."""
try:
exp = Experiment(db.init_db(drop_all=False))
except Exception as ex:
- Read upRead up
- Create a ticketCreate a ticket
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 crossdomain
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def crossdomain(
origin=None,
methods=None,
headers=None,
max_age=21600,
- Read upRead up
- Create a ticketCreate a ticket
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 request_parameter
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def request_parameter(parameter, parameter_type=None, default=None, optional=False):
"""Get a parameter from a request.
parameter is the name of the parameter you are looking for
parameter_type is the type the parameter should have
- Read upRead up
- Create a ticketCreate a ticket
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 push
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def push(use_existing: bool, **kwargs) -> str:
"""Build and push the docker image for this experiment."""
from docker import client
from dallinger.docker.tools import build_image
- Read upRead up
- Create a ticketCreate a ticket
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"