Showing 230 of 230 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
angular.module('adage.participation.resources', [
'ngResource',
'adage.utils'
])
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 76.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
angular.module('adage.signature.resources', [
'ngResource',
'adage.utils'
])
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 76.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function AnalysisCtrl
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function AnalysisCtrl($scope, $log, $q, $state, $stateParams,
SampleBin, Sample) {
$scope.isValidModel = false;
// Do nothing if mlmodel in URL is falsey. The error will be taken
// care of by "<ml-model-validator>" component.
Function controller
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function($scope, $state, Gene, SelectedGenesFactory, CommonGeneFuncts) {
var numResultsToReturn = 10;
$scope.errors = null;
$scope.autocompleteQuery = '';
$scope.selectedGenes = SelectedGenesFactory.returnGenes();
Function link
has 43 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 calculateEnrichments
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
var calculateEnrichments = function(typeName, genesBySignatures) {
var m = genesInUrl.length,
N = self.geneNum,
pValueArray = [],
matchedGenesBySignature = [],
Function controller
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function($log, Genesets, Gene, errGen) {
var self = this;
self.search = {};
Similar blocks of code found in 2 locations. Consider refactoring. Open
findEnrichedSignatures: function(scope, state) {
var geneIds = Object.keys(scope.selectedGenes);
var geneString = geneIds.join();
state.go('enriched_signatures', {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 72.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function SearchCtrl
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function SearchCtrl($scope, $log, $location, Search) {
$scope.results = [];
$scope.search = {
query: {
text: '',
Similar blocks of code found in 2 locations. Consider refactoring. Open
sendToNetwork: function(scope, state) {
var geneIds = Object.keys(scope.selectedGenes);
var geneString = geneIds.join();
state.go('gene_network', {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 72.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function get_annotations
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def get_annotations(request=None, **kwargs):
"""
Return a tab-delimited file containing all samples for every Experiment
with Sample properties for each and all annotations (by default) or, if
`annotation_types` is specified, return only those annotation types for
- 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 handleExperimentResponse
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
var handleExperimentResponse = function(response) {
// enhanceExpData: a function that enhances the given experiment.
// The enhancements include:
// (1) Convert entries in sample_set from sample URI to sample ID,
// and delete samples that are not related to current signature;
Function mapSignaturesToSignatureInfo
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
var mapSignaturesToSignatureInfo = function() {
// (2a) next, we build an array (replacing `volcanoData.source`)
// comprised of `signatureObject`s by walking through the
// `firstSampleSignatures` and constructing a `signatureObject` for
// each. [outer .map()]
Function controller
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function($scope, SelectedGenesFactory) {
$scope.currentPage = 1;
$scope.itemsPerPage = 10;
$scope.totalResults = 0;
$scope.maxSize = 10;
Function setSpec
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.setSpec = function(activities) {
var activityArr = [];
var samples = Object.keys(activities);
samples.forEach(function(sampleID, index) {
activityArr.push({
Function VolcanoPlotViewCtrl
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function VolcanoPlotViewCtrl(SampleBin, $stateParams) {
var ctrl = this;
ctrl.isValidModel = false;
// Do nothing if mlmodel in URL is falsey. The error will be taken
// care of by "<ml-model-validator>" component.
Function searchGenesets
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
self.searchGenesets = function() {
self.searchStatus = 'Searching for gene sets...';
var qparams = {
'query': self.search.query,
'organism__scientific_name': self.organism,
Function showEdgeTip
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showEdgeTip(data) {
geneTip.hide(); // Hide gene-tip window (if any) first.
var weightPrecision = 3;
var htmlText = 'Edge weight: ';
htmlText += data.weight.toFixed(weightPrecision);
Function controller
has 36 lines of code (exceeds 25 allowed). Consider refactoring. 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
ctrl.show = function(id) {
if (!id) {
$log.warn(
'adage.experimentDetail.component: show() called with id',
id