Showing 82 of 230 total issues
Function controller
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function($scope, SelectedGenesFactory, CommonGeneFuncts) {
$scope.buttonPage = 1;
$scope.queryResults = $scope.searchResults[$scope.query];
var selectedGenes = SelectedGenesFactory.returnGenes();
Function show
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ctrl.show = function(id) {
if (!id) {
$log.warn(
'adage.experimentDetail.component: show() called with id',
id
Function DownloadController
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function DownloadController($window, $log, AnnotationTypes) {
var self = this;
self.queryStatus = 'Connecting to the server ...';
self.fixedTypes = ['experiment', 'sample_name', 'ml_data_source'];
self.includedTypes = [];
Function success
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
sidPromise.then(function success(validSamples) {
Sample.get(
{'id__in': validSamples, 'limit': 0}, // parameters of GET
function success(response) {
// If no valid sample records are found, report the error.
Function success
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function success(responseObject) {
// Function that calculates input gene's expression value
// based on the input array of base and comparison sums.
var calcGeneExpr = function(geneID, exprTracker) {
// Do nothing if the length of exprTracker is not 4, or one
Function getSignatureSetPromise
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getSignatureSetPromise: function(pkArr) {
// Check for any pk already cached, then retrieve what's missing in
// bulk via the set endpoint on the signature API. Return a promise and
// supply a callback that populates the cache when the API returns.
var cbSampleBin = this; // closure link to SampleBin for callbacks
Function create_participations
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
def create_participations(num_signatures, num_genes):
"""
Static method that builds Participation table based on the input
number of signatures and number of genes.
"""
- 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 controller
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function($scope, UserFactory, $uibModal, $rootScope, $window) {
UserFactory.getPromise().then(function() {
$scope.userObj = UserFactory.getUser();
});
Function updateHeatmapActivity
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var updateHeatmapActivity = function() {
// when all promises are fulfilled, we can update vegaData
var newActivity = [];
var excludeSamples = [];
Function SignatureController
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function SignatureController($stateParams, Signature, $log, errGen) {
var self = this;
self.isValidModel = false;
// Do nothing if the model ID in URL is falsey. The error will be taken
// care of by "<ml-model-validator>" component.
Function setUp
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def setUp(self):
super(APIResourceTestCase, self).setUp()
# create a test experiment to retrive with the API
self.test_experiment = ModelsTestCase.experiment_data
ModelsTestCase.create_test_experiment(
Function getSampleListPromise
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Sample.getSampleListPromise = function(pkList) {
return $q(function(resolve, reject) {
var cachedSamples = [];
var promisedSampleIDs = [];
var newSamplePromises = [];
Function controller
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
controller: ['$scope', 'Gene', function($scope, Gene) {
$scope.errors = null;
$scope.searchGenes = function() {
// Gene.search will query for all of the search terms in qparams,
Function show
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ctrl.show = function(id) {
if (!id) {
$log.warn('adage.sampleDetail.component: show() called with id', id);
return;
}
Function searchGenes
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.searchGenes = function(val) {
$scope.loadingGenes = true;
var qparams = {
'query': val,
'organism': $scope.organism
Function openLoginModal
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.openLoginModal = function() {
var modalInstance = $uibModal.open({
templateUrl: 'tribe_client/tribe-login-modal.tpl.html',
controller: [
'$scope', '$uibModalInstance', 'TribeSettings',
Function getEnrichedSignatures
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var getEnrichedSignatures = function() {
participations.forEach(function(element) {
var sigID = element.signature;
if (!self.signatures[sigID]) {
return;
Function getSampleIDPromise
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var getSampleIDPromise = function() {
var deferred = $q.defer();
// If 'signature' is found in the URL, get the activity values based on
// signature and sample(s):
if ($stateParams.signature) {
Function get
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
get: function() {
$scope.results = [];
$scope.search.query.status = '';
if (!$scope.search.query.text) {
$log.info('Query text is empty, so skipping search.');
Function SignatureController
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function SignatureController(Signature, $stateParams, MlModelTracker, $log,
errGen) {
var self = this;
if (!$stateParams.id) {
self.statusMessage = 'Please specify signature ID in the URL.';