Showing 224 of 1,035 total issues
Function draw_network
has a Cognitive Complexity of 136 (exceeds 5 allowed). Consider refactoring. Open
var draw_network = function () {
var template_globals = templateGlobals();
var network = null;
var net_structure = template_globals.network_structure || {}; // this is a container for all the data coming from the route
var vis_options = template_globals.vis_options || {}; // This is a set of overrides for the vis options
- 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 draw_network
has 525 lines of code (exceeds 25 allowed). Consider refactoring. Open
var draw_network = function () {
var template_globals = templateGlobals();
var network = null;
var net_structure = template_globals.network_structure || {}; // this is a container for all the data coming from the route
var vis_options = template_globals.vis_options || {}; // This is a set of overrides for the vis options
- Create a ticketCreate a ticket
File experiment.py
has 1462 lines of code (exceeds 750 allowed). Consider refactoring. Open
"""The base experiment class."""
from __future__ import print_function, unicode_literals
import datetime
- Create a ticketCreate a ticket
File models.py
has 1412 lines of code (exceeds 750 allowed). Consider refactoring. Open
"""Define Dallinger's core models."""
import inspect
from datetime import datetime
- Create a ticketCreate a ticket
Function dallinger
has 435 lines of code (exceeds 25 allowed). Consider refactoring. Open
var dallinger = (function () {
/**
* @namespace
* @alias dallinger
*/
- Create a ticketCreate a ticket
File recruiters.py
has 1384 lines of code (exceeds 750 allowed). Consider refactoring. Open
"""Recruiters manage the flow of participants to the experiment."""
from __future__ import unicode_literals
import json
- Create a ticketCreate a ticket
File experiment_server.py
has 1382 lines of code (exceeds 750 allowed). Consider refactoring. Open
""" This module provides the backend Flask server that serves an experiment. """
import os
import re
from datetime import datetime
- Create a ticketCreate a ticket
Experiment
has 85 functions (exceeds 20 allowed). Consider refactoring. Open
class Experiment(object):
"""Define the structure of an experiment."""
app_id = None
exp_config = None
- Create a ticketCreate a ticket
Function dallinger
has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring. Open
var dallinger = (function () {
/**
* @namespace
* @alias dallinger
*/
- 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 getnNetwork
has 306 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getnNetwork() {
var i, j, from, to, roles, net, networks_roles, my_role, mclr,
is_found, roles_colors, clr, rr, gg, bb, count_nodes,
participant, participant_id, node, msg, mgroup, vector,
info, my_node_id, tran, group_fathers, gtitle, min_id,
- Create a ticketCreate a ticket
Function deploy
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
def deploy(
image_name, mode, server, dns_host, app_name, config_options, archive_path, update
): # pragma: no cover
"""Deploy a dallinger experiment docker image to a server using ssh."""
config = get_config()
- 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 handle_error
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def handle_error():
request_data = request.form.get("request_data")
error_feedback = request.form.get("error_feedback")
error_type = request.form.get("error_type")
error_text = request.form.get("error_text")
- 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
MTurkService
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
class MTurkService(object):
"""Facade for Amazon Mechanical Turk services provided via the boto3
library.
"""
- Create a ticketCreate a ticket
Function init
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
ScribeDallingerTracker.prototype.init = function() {
var config = this.config;
var getNodeDescriptor = function(node) {
return {
id: node.id,
- 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 worker_function
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def worker_function(
event_type,
assignment_id,
participant_id,
node_id=None,
- 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 getOptions
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getOptions() {
var options = {
layout: {
improvedLayout: false,
hierarchical: {
- Create a ticketCreate a ticket
Function receive_message
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def receive_message(
self, message, channel_name=None, participant=None, node=None, receive_time=None
):
"""We recieve all messages coming into the ``chatroom`` channel along with
the ``dallinger_control`` channel. We store all user messages as
- 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
HerokuApp
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
class HerokuApp(HerokuCommandRunner):
"""Representation of a Heroku app"""
def __init__(self, dallinger_uid, output=None, team=None):
self.dallinger_uid = dallinger_uid
- Create a ticketCreate a ticket
Function extend
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def extend(self, mapping, cast_types=False, strict=False):
normalized_mapping = {}
for key, value in mapping.items():
key = self.synonyms.get(key, key)
test_deprecation(key)
- 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 prep_datatables_options
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def prep_datatables_options(table_data):
"""Attempts to generate a reasonable a DataTables config"""
datatables_options = deepcopy(TABLE_DEFAULTS)
datatables_options.update(deepcopy(table_data))
# Display objects and arrays in useful ways
- 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"