Showing 224 of 1,036 total issues
Function user_log_dir
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def user_log_dir(appname=None, appauthor=None, version=None, opinion=True):
r"""Return full path to the user-specific log 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 dashboard_fail
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def dashboard_fail(self, data):
"""Marks matching non-failed items as failed. Items are looked up by
``id`` and ``object_type`` (e.g. ``"Participant"``).
:param data: A list of dicts representing model items to be marked as failed.
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def crossdomain(
- Create a ticketCreate a ticket
Function copy_docker_config
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def copy_docker_config(host, user):
executor = Executor(host, user)
local_docker_conf_path = os.path.expanduser("~/.docker/config.json")
if os.path.exists(local_docker_conf_path):
- 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_question
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create_question(participant_id):
"""Send a POST request to the question table.
Questions store information at the participant level, not the node
level.
- 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 qualify
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def qualify(workers, qualification, value, by_name, notify, sandbox):
- Create a ticketCreate a ticket
Function handle_launch_data
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def handle_launch_data(url, error, delay=DEFAULT_DELAY, attempts=MAX_ATTEMPTS):
"""Sends a POST request to te given `url`, retrying it with exponential backoff.
The passed `error` function is invoked to give feedback as each error occurs,
possibly multiple times.
"""
- 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 selenium_recruits
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def selenium_recruits(request, recruitment_loop):
def recruits():
for url in recruitment_loop:
kwargs = {}
driver_class = DRIVER_MAP.get(request.param, webdriver.Chrome)
- 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 error_response
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def error_response(
- Create a ticketCreate a ticket
Function tracker
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
ScribeDallingerTracker.prototype.tracker = function(info) {
var config = this.config;
var path = info.path;
var value = this.stripPII(info.value || {});
var data = new FormData();
- 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
Avoid deeply nested control flow statements. Open
} else if (atom.input.pressed('toggle_pause')) {
if (!this.gstarted) {
createInfo("Info", JSON.stringify({"move": "unpause"}));
this.eraseCanvas();
this.startGame();
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (other && other.value === tile.value) {
return true; // These two tiles can be merged
}
- Create a ticketCreate a ticket
Function setup_experiment
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def setup_experiment(
- Create a ticketCreate a ticket
Function check_experiment_dependencies
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def check_experiment_dependencies(requirements_file):
"""Verify that the dependencies defined in a requirements file are
in fact installed.
If the environment variable SKIP_DEPENDENCY_CHECK is set, no check
will be performed.
- 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 get_base_url
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_base_url():
"""Returns the base url for the experiment.
Looks into environment variable HOST first, then in the
experiment config.
If the URL is on Heroku makes sure the protocol is https.
- 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
Avoid deeply nested control flow statements. Open
for fn in filenames:
dst_fileparts = (
[dst, filename] + [os.path.relpath(dirpath, src)] + [fn]
)
dst_filepath = os.path.join(*dst_fileparts)
- Create a ticketCreate a ticket
Function open_recruitment
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def open_recruitment(self, n=1):
"""Return initial experiment URL list."""
logger.info("Multi recruitment running for {} participants".format(n))
recruitments = []
messages = {}
- 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 _assign_experiment_qualifications
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _assign_experiment_qualifications(self, worker_id, qualifications):
# Called from an async worker.
by_name = {qual["name"]: qual for qual in qualifications}
result = self._ensure_mturk_qualifications(qualifications)
for qual in result["new_qualifications"]:
- 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 _register_hit_type
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _register_hit_type(
- Create a ticketCreate a ticket
Function write
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def write(self, filter_sensitive=False, directory=None):
parser = configparser.ConfigParser()
parser.add_section("Parameters")
for layer in reversed(self.data):
for k, v in layer.items():
- 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"