Showing 294 of 518 total issues
File database.py
has 1099 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
import argparse
import bson
import copy
Function is_session_compliant
has a Cognitive Complexity of 96 (exceeds 5 allowed). Consider refactoring. Open
def is_session_compliant(session, template):
"""
Given a project-level session template and a session,
returns True/False if the session is in compliance with the template
"""
- 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
File dataexplorerhandler.py
has 710 lines of code (exceeds 250 allowed). Consider refactoring. Open
import copy
import json
from elasticsearch import ElasticsearchException, TransportError, RequestError, helpers
File reporthandler.py
has 704 lines of code (exceeds 250 allowed). Consider refactoring. Open
import bson
import copy
import unicodecsv as csv
import datetime
import dateutil
Function upgrade_to_21
has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring. Open
def upgrade_to_21():
"""
scitran/core issue #189 - Data Model v2
Field `metadata` renamed to `info`
- 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
has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring. Open
def get(self, cont_name, list_name, **kwargs):
_id = kwargs.pop('cid')
permchecker, storage, _, _, keycheck = self._initialize_request(cont_name, list_name, _id)
list_name = storage.list_name
filename = kwargs.get('name')
- 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
File listhandler.py
has 561 lines of code (exceeds 250 allowed). Consider refactoring. Open
import os
import bson
import copy
import datetime
import dateutil
Function download
has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring. Open
def download(self, **kwargs):
"""
.. http:get:: /api/(cont_name)*/(cid)*/analyses/(analysis_id)/{filegroup:inputs|files}/(filename)*
* - not required
- 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 exports
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(grunt) {
var path = require('path');
var fs = require('fs');
var _ = require('lodash');
var yaml = require('js-yaml');
- 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
File handlers.py
has 533 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
API request handlers for the jobs module
"""
import bson
import copy
File placer.py
has 532 lines of code (exceeds 250 allowed). Consider refactoring. Open
import bson
import copy
import datetime
import dateutil
import os
Function _preflight_archivestream
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
def _preflight_archivestream(self, req_spec, collection=None):
data_path = config.get_item('persistent', 'data_path')
arc_prefix = self.get_param('prefix', 'scitran')
file_cnt = 0
total_size = 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 exports
has 213 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt) {
var path = require('path');
var fs = require('fs');
var _ = require('lodash');
var yaml = require('js-yaml');
File containerhandler.py
has 509 lines of code (exceeds 250 allowed). Consider refactoring. Open
import bson
import datetime
import dateutil
from .. import config
Function _parse_request
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
def _parse_request(self, request_type='search'):
try:
request = self.request.json_body
except (ValueError):
- 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
File hierarchy.py
has 475 lines of code (exceeds 250 allowed). Consider refactoring. Open
import bson
import copy
import datetime
import dateutil.parser
import difflib
Function resolve
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def resolve(self):
"""Resolve a path through the hierarchy."""
if self.public_request:
self.abort(403, 'Request requires login')
- 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
File containerstorage.py
has 406 lines of code (exceeds 250 allowed). Consider refactoring. Open
import datetime
import bson
import copy
Function initialization_auth
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def initialization_auth(self):
drone_request = False
job_context = None
session_token = self.request.headers.get('Authorization', None)
drone_secret = self.request.headers.get('X-SciTran-Auth', None)
- 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
File dicom_doctype.py
has 378 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
import ast
import copy
import dateutil.parser