Showing 82 of 230 total issues
Function exports
has 471 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function ( grunt ) {
/**
* Load required Grunt tasks. These are installed based on the versions listed
* in `package.json` when you do `npm install` in this directory.
File tests.py
has 945 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding: utf-8 (see https://www.python.org/dev/peps/pep-0263/)
from __future__ import unicode_literals
from __future__ import print_function
import os
Function GeneNetworkController
has a Cognitive Complexity of 103 (exceeds 5 allowed). Consider refactoring. Open
function GeneNetworkController(
$stateParams, Edge, Signature, Gene, ExpressionValue, $log, errGen,
$httpParamSerializerJQLike, $scope, MlModelTracker, $timeout
) {
var self = this;
- 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 GeneNetworkController
has 414 lines of code (exceeds 25 allowed). Consider refactoring. Open
function GeneNetworkController(
$stateParams, Edge, Signature, Gene, ExpressionValue, $log, errGen,
$httpParamSerializerJQLike, $scope, MlModelTracker, $timeout
) {
var self = this;
File network.js
has 477 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* "adage.gene.network" module.
*/
angular.module('adage.gene.network', [
File Gruntfile.js
has 473 lines of code (exceeds 250 allowed). Consider refactoring. Open
module.exports = function ( grunt ) {
/**
* Load required Grunt tasks. These are installed based on the versions listed
* in `package.json` when you do `npm install` in this directory.
Function bootstrap_database
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def bootstrap_database(annotation_fh, dir_name=None):
"""
Import initial experiment, sample and annotation data to initialize the
ADAGE database. Assumes we are starting with an empty database, so this
will fail if any existing data are found that conflict with what is being
- 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
APIResourceTestCase
has 45 functions (exceeds 20 allowed). Consider refactoring. Open
class APIResourceTestCase(ResourceTestCaseMixin, TestCase):
# API tests:
# For most of our interfaces, we should be able to GET, but every other
# REST API should fail: POST, PUT, PATCH, DELETE. There are a few
# exceptions for which we allow POST but the behavior is the same as GET.
Function EnrichedSignatureController
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
function EnrichedSignatureController($stateParams, Signature, Participation,
Gene, MlModelTracker, MathFuncts, pValueCutoff, pValueDigits, $scope, $q,
$log, errGen) {
var self = this;
self.isValidModel = false;
File api.py
has 414 lines of code (exceeds 250 allowed). Consider refactoring. Open
from django.conf.urls import url
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Q
from django.http import HttpResponse
from organisms.api import OrganismResource
File signature.js
has 375 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* "adage.signature" module.
*/
angular.module('adage.signature', [
Function check_and_import
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def check_and_import(file_handle, ml_model):
"""Read valid data lines into the database. An exception will be raised
if any errors are detected in file_handle.
"""
# If the database already includes record(s) of the same ml_model,
- 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 drawNetwork
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawNetwork() {
// Calculate svg size.
var minSvgSize = 600; // Minimum size of svg.
var maxSvgSize = 1280; // Maximum size of svg.
var svgSize = genes.length * 10;
Function link
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function($scope) {
$scope.queryStatus = 'Connecting to the server ...';
$scope.activities = {};
$scope.experiments = [];
$scope.topMode = true;
Function success
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
function success(responseObject) {
var edgeList = responseObject.objects;
// Collect a list of distinct genes for query.
var geneList = getQueriedGenes(edgeList);
// Now retrieve the Gene objects using the geneList.
Function link
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function($scope) {
$scope.queryStatus = 'Connecting to the server ...';
$scope.topMode = true;
$scope.topNum = 3;
Function success
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
function success(responseObject) {
setGenes(responseObject);
if (genes.length === 0) {
self.statusMessage =
'Gene(s) not found, please check the gene ID.';
Function getVolcanoPlotData
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
getVolcanoPlotData: function() {
// use sample lists for base-group and comp-group to produce output for
// the volcano plot of the form:
// signature - diff - logsig,
// where:
Function check_and_import
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def check_and_import(file_handle, ml_model, participation_type):
"""Read valid data lines into the database. An exception will be
raised if any errors are detected in file_handle.
"""
signatures_in_file = set()
- 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 rebuildHeatmapActivity
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
rebuildHeatmapActivity: function() {
if (!this.mlmodel.id) {
// ignore "rebuild" requests until a model is specified
$log.info(
'rebuildHeatmapActivity: skipping because mlmodel=', this.mlmodel