Showing 294 of 518 total issues
Function finalize
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def finalize(self):
paths = os.listdir(self.folder)
total = len(paths)
Function objWalk
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function objWalk(obj, callback, path, state) {
var i, idx;
state = state || {};
if( path ) {
- 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_jobs
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def get_jobs(self, cid):
# Only enabled for sessions container type per url rule in api.py
self.config = self.container_handler_configurations["sessions"]
self.storage = self.config['storage']
cont = self._get_container(cid, projection={'files': 0, 'metadata': 0}, get_children=True)
- 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 key_check
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def key_check(schema_url):
"""
for sublists of mongo container there is no automatic key check when creating, updating or deleting an object.
We are adding a custom array field to the json schemas ("key_fields").
The uniqueness is checked on the combination of all the elements of "key_fields".
- 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 upgrade_to_24
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def upgrade_to_24():
"""
scitran/core issue #720
Migrate gear rules to the project level
- 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 recalc_session_compliance
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def recalc_session_compliance(self, session_id, session=None, template=None, hard=False):
"""
Calculates a session's compliance with the project's session template.
Returns True if the status changed, False otherwise
"""
- 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 draft4ToOpenApi2
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
SchemaTranspiler.prototype.draft4ToOpenApi2 = function(schema, defs, id) {
var ref, defname;
// Drop the $schema property, and make a copy
schema = _.omit(schema, OMITTED_PROPERTIES);
Function simplifySchema
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function simplifySchema(schema, path, context) {
schema = _.cloneDeep(schema);
// If an x-sdk-schema is specified, use that
if( schema['x-sdk-schema'] ) {
schema = schema['x-sdk-schema'];
Function list_permission_checker
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def list_permission_checker(handler, uid=None):
def g(exec_op):
def f(method, query=None, projection=None):
if uid is not None:
if uid != handler.uid and not handler.superuser_request and not handler.user_is_admin:
- 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_html_generator
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def get_html_generator(_id):
log = config.db.job_logs.find_one({'_id': _id})
if log is None:
yield '<span class="fd--1">No logs were found for this job.</span>'
- 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 container_has_original_data
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def container_has_original_data(container, child_cont_name=None):
"""
Given a container, creates a list of all origin types
for all files in the container and it's children, if provided.
If the set only includes user and job uploaded files, the container
- 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_all_el
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def get_all_el(self, query, user, projection, fill_defaults=False):
if query is None:
query = {}
if user:
if query.get('permissions'):
- 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 resolveRefs
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Schemas.prototype.resolveRefs = function(relpath, obj, jsonpath) {
var $ref, parts, curpath, actualpath, pathpart;
// Ignore examples
if( jsonpath && jsonpath[jsonpath.length-1] === 'example' ) {
return obj;
Function exec_op
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def exec_op(self, action, _id=None, payload=None, query=None, user=None,
Function mergeModels
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mergeModels(root, context) {
var defs = root.definitions||{};
var keys = _.keys(defs);
var models = {};
var aliases = {};
Function _process_demo_results
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _process_demo_results(self, results, grid):
"""
Given demographics aggregation results, fill in base demographics grid
All `null` or unlisted values will be counted as 'Unknown or Not Reported'
- 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 start_job
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def start_job(tags=None, peek=False):
"""
Atomically change a 'pending' job to 'running' and returns it. Updates timestamp.
Will return None if there are no jobs to offer. Searches for jobs in FIFO order.
- 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 collection_permissions
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def collection_permissions(handler, container=None, _=None):
"""
Collections don't have a parent_container, catch param from generic call with _.
Permissions are checked on the collection itself or not at all if the collection is new.
"""
- 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 run
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def run(batch_job):
"""
Creates jobs from proposed inputs, returns jobs enqueued.
"""
- 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 suggest
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def suggest(self, _id, cont_name, cid):
"""
Given a container reference, return display information about parents, children and files
as well as information about which best match each gear input
- 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"