Showing 1,095 of 1,095 total issues
Function DataManagerForIviz
has 1548 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.DataManagerForIviz = (function($, _) {
var content = {};
// Clinical attributes will be transferred into table.
var configs_;
Function init
has 1498 lines of code (exceeds 25 allowed). Consider refactoring. Open
content.init = function(_portalUrl, _study_cases_map) {
_study_cases_map = _study_cases_map || {};
_.map(_study_cases_map, function(item) {
if (_.isArray(item.samples)) {
item.samples.sort();
Function util
has a Cognitive Complexity of 276 (exceeds 5 allowed). Consider refactoring. Open
var util = (function(_, cbio) {
return (function() {
function tableDownload(fileType, content) {
switch (fileType) {
case 'tsv':
- 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 dataProxy.js
has 1551 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
window.DataManagerForIviz = (function($, _) {
var content = {};
// Clinical attributes will be transferred into table.
Function iViz
has 760 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.iViz = (function(_, $, cbio, QueryByGeneUtil, QueryByGeneTextArea) {
var data_;
var vm_;
var tableData_ = [];
var groupFiltersMap_ = {};
Function util
has 723 lines of code (exceeds 25 allowed). Consider refactoring. Open
var util = (function(_, cbio) {
return (function() {
function tableDownload(fileType, content) {
switch (fileType) {
case 'tsv':
Similar blocks of code found in 2 locations. Consider refactoring. Open
$.when(self.getClinicalAttributesByStudy())
.done(function(attributes) {
var studyCasesMap = self.getStudyCasesMap();
var studyAttributesMap = {};
if (!_.isArray(attr_ids)) {
- 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 547.
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
$.when(self.getClinicalAttributesByStudy())
.then(function(attributes) {
var studyCasesMap = self.getStudyCasesMap();
var studyAttributesMap = {};
if (!_.isArray(attr_ids)) {
- 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 547.
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 BarChart
has 487 lines of code (exceeds 25 allowed). Consider refactoring. Open
iViz.view.component.BarChart = function() {
var content = this;
var chartInst_;// DC chart instance.
var opts_ = {};// Chart configuration options
Function initialSetup
has 472 lines of code (exceeds 25 allowed). Consider refactoring. Open
var initialSetup = function() {
var _def = new $.Deferred();
var self = this;
var vueInstance = iViz.vue.manage.getInstance();
vueInstance.increaseStudyViewSummaryPagePBStatus();
Function DataManagerForIviz
has a Cognitive Complexity of 112 (exceeds 5 allowed). Consider refactoring. Open
window.DataManagerForIviz = (function($, _) {
var content = {};
// Clinical attributes will be transferred into table.
var configs_;
- 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 PieChart
has 421 lines of code (exceeds 25 allowed). Consider refactoring. Open
iViz.view.component.PieChart = function(ndx, attributes, opts, cluster) {
var content = this;
var v = {};
v.chart = '';
Function TableView
has 408 lines of code (exceeds 25 allowed). Consider refactoring. Open
iViz.view.component.TableView = function() {
var content = this;
var chartId_;
var data_ = [];
var type_ = '';
Function exports
has 401 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt) {
// Time how long tasks take. Can help when optimizing build times
require('time-grunt')(grunt);
// Automatically load required grunt tasks
Function manage
has 382 lines of code (exceeds 25 allowed). Consider refactoring. Open
iViz.vue.manage = (function() {
var vmInstance_;
return {
init: function() {
Function init
has 362 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function() {
vmInstance_ = new Vue({
el: '#complete-screen',
data: {
groups: [],
File main.js
has 767 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
window.iViz = (function(_, $, cbio, QueryByGeneUtil, QueryByGeneTextArea) {
var data_;
var vm_;
var tableData_ = [];
File util.js
has 731 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
var util = (function(_, cbio) {
return (function() {
function tableDownload(fileType, content) {
switch (fileType) {
File barChart.js
has 714 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
(function(iViz, dc, _, $, d3, cbio) {
// iViz pie chart component. It includes DC pie chart.
iViz.view.component.BarChart = function() {
var content = this;
Function iViz
has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring. Open
window.iViz = (function(_, $, cbio, QueryByGeneUtil, QueryByGeneTextArea) {
var data_;
var vm_;
var tableData_ = [];
var groupFiltersMap_ = {};
- 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"