midasplatform/Midas

View on GitHub
modules/visualize/public/js/paraview/paraview.volume.js

Summary

Maintainability
F
3 wks
Test Coverage

File paraview.volume.js has 602 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Midas Server. Copyright Kitware SAS. Licensed under the Apache License 2.0.

/* global JavaScriptRenderer */
/* global json */

Severity: Major
Found in modules/visualize/public/js/paraview/paraview.volume.js - About 1 day to fix

Function setupExtractSubgrid has 89 lines of code (exceeds 25 allowed). Consider refactoring.
Open

midas.visualize.setupExtractSubgrid = function () {
    'use strict';
    var dialog = $('#extractSubgridDialogTemplate').clone();
    dialog.removeAttr('id');
    $('#extractSubgridAction').click(function () {
Severity: Major
Found in modules/visualize/public/js/paraview/paraview.volume.js - About 3 hrs to fix

Function setupColorMapping has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

midas.visualize.setupColorMapping = function () {
    'use strict';
    var dialog = $('#scmDialogTemplate').clone();
    dialog.removeAttr('id');
    $('#scmEditAction').click(function () {
Severity: Major
Found in modules/visualize/public/js/paraview/paraview.volume.js - About 3 hrs to fix

Function setupOverlay has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

midas.visualize.setupOverlay = function () {
    'use strict';
    $('button.plusX').click(function () {
        paraview.callPluginMethod('midascommon', 'SetCamera', {
            cameraPosition: [
Severity: Major
Found in modules/visualize/public/js/paraview/paraview.volume.js - About 2 hrs to fix

Function setupScalarOpacity has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

midas.visualize.setupScalarOpacity = function () {
    'use strict';
    var dialog = $('#sofDialogTemplate').clone();
    dialog.removeAttr('id');
    $('#sofEditAction').click(function () {
Severity: Major
Found in modules/visualize/public/js/paraview/paraview.volume.js - About 2 hrs to fix

Function setupSofPlotBindings has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

midas.visualize.setupSofPlotBindings = function () {
    'use strict';
    // Clicking an existing point should let you change its values
    $('#sofChartDiv').bind('jqplotDataClick', function (ev, seriesIndex, pointIndex, data) {
        var container = $('div.MainDialog').find('div.sofPointEdit');
Severity: Minor
Found in modules/visualize/public/js/paraview/paraview.volume.js - About 1 hr to fix

Function _dataOpened has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

midas.visualize._dataOpened = function (view, retVal) {
    'use strict';
    midas.visualize.input = retVal.input;
    midas.visualize.bounds = retVal.imageData.Bounds;
    midas.visualize.meshes = retVal.meshes;
Severity: Minor
Found in modules/visualize/public/js/paraview/paraview.volume.js - About 1 hr to fix

Function setupObjectList has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

midas.visualize.setupObjectList = function () {
    'use strict';
    var dialog = $('#objectListTemplate').clone();
    dialog.removeAttr('id');
    $('#objectListAction').click(function () {
Severity: Minor
Found in modules/visualize/public/js/paraview/paraview.volume.js - About 1 hr to fix

Function toggleObjectVisibility has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

midas.visualize.toggleObjectVisibility = function (checkbox) {
    'use strict';
    var type = checkbox.attr('vis');
    var itemId = checkbox.attr('element');
    var proxy;
Severity: Minor
Found in modules/visualize/public/js/paraview/paraview.volume.js - About 1 hr to fix

Function renderPointList has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function renderPointList(colorMap) {
            for (var i = 0; i < colorMap.length; i += 4) {
                var rgbPoint = $('#scmPointMapTemplate').clone();
                var r = Math.round(255 * colorMap[i + 1]);
                var g = Math.round(255 * colorMap[i + 2]);
Severity: Minor
Found in modules/visualize/public/js/paraview/paraview.volume.js - About 1 hr to fix

Function toggleObjectVisibility has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

midas.visualize.toggleObjectVisibility = function (checkbox) {
    'use strict';
    var type = checkbox.attr('vis');
    var itemId = checkbox.attr('element');
    var proxy;
Severity: Minor
Found in modules/visualize/public/js/paraview/paraview.volume.js - About 35 mins to fix

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

Strings must use singlequote.
Open

        midas.visualize.renderers.js = new JavaScriptRenderer("jsRenderer", "/PWService");

enforce the consistent use of either backticks, double, or single quotes (quotes)

JavaScript allows you to define strings in one of three ways: double quotes, single quotes, and backticks (as of ECMAScript 6). For example:

/*eslint-env es6*/

var double = "double";
var single = 'single';
var backtick = `backtick`;    // ES6 only

Each of these lines creates a string and, in some cases, can be used interchangeably. The choice of how to define strings in a codebase is a stylistic one outside of template literals (which allow embedded of expressions to be interpreted).

Many codebases require strings to be defined in a consistent manner.

Rule Details

This rule enforces the consistent use of either backticks, double, or single quotes.

Options

This rule has two options, a string option and an object option.

String option:

  • "double" (default) requires the use of double quotes wherever possible
  • "single" requires the use of single quotes wherever possible
  • "backtick" requires the use of backticks wherever possible

Object option:

  • "avoidEscape": true allows strings to use single-quotes or double-quotes so long as the string contains a quote that would have to be escaped otherwise
  • "allowTemplateLiterals": true allows strings to use backticks

Deprecated: The object property avoid-escape is deprecated; please use the object property avoidEscape instead.

double

Examples of incorrect code for this rule with the default "double" option:

/*eslint quotes: ["error", "double"]*/

var single = 'single';
var unescaped = 'a string containing "double" quotes';

Examples of correct code for this rule with the default "double" option:

/*eslint quotes: ["error", "double"]*/
/*eslint-env es6*/

var double = "double";
var backtick = `back\ntick`;  // backticks are allowed due to newline
var backtick = tag`backtick`; // backticks are allowed due to tag

single

Examples of incorrect code for this rule with the "single" option:

/*eslint quotes: ["error", "single"]*/

var double = "double";
var unescaped = "a string containing 'single' quotes";

Examples of correct code for this rule with the "single" option:

/*eslint quotes: ["error", "single"]*/
/*eslint-env es6*/

var single = 'single';
var backtick = `back${x}tick`; // backticks are allowed due to substitution

backticks

Examples of incorrect code for this rule with the "backtick" option:

/*eslint quotes: ["error", "backtick"]*/

var single = 'single';
var double = "double";
var unescaped = 'a string containing `backticks`';

Examples of correct code for this rule with the "backtick" option:

/*eslint quotes: ["error", "backtick"]*/
/*eslint-env es6*/

var backtick = `backtick`;

avoidEscape

Examples of additional correct code for this rule with the "double", { "avoidEscape": true } options:

/*eslint quotes: ["error", "double", { "avoidEscape": true }]*/

var single = 'a string containing "double" quotes';

Examples of additional correct code for this rule with the "single", { "avoidEscape": true } options:

/*eslint quotes: ["error", "single", { "avoidEscape": true }]*/

var double = "a string containing 'single' quotes";

Examples of additional correct code for this rule with the "backtick", { "avoidEscape": true } options:

/*eslint quotes: ["error", "backtick", { "avoidEscape": true }]*/

var double = "a string containing `backtick` quotes"

allowTemplateLiterals

Examples of additional correct code for this rule with the "double", { "allowTemplateLiterals": true } options:

/*eslint quotes: ["error", "double", { "allowTemplateLiterals": true }]*/

var double = "double";
var double = `double`;

Examples of additional correct code for this rule with the "single", { "allowTemplateLiterals": true } options:

/*eslint quotes: ["error", "single", { "allowTemplateLiterals": true }]*/

var single = 'single';
var single = `single`;

When Not To Use It

If you do not need consistency in your string styles, you can safely disable this rule. Source: http://eslint.org/docs/rules/

Strings must use singlequote.
Open

    paraview = new Paraview("/PWService");

enforce the consistent use of either backticks, double, or single quotes (quotes)

JavaScript allows you to define strings in one of three ways: double quotes, single quotes, and backticks (as of ECMAScript 6). For example:

/*eslint-env es6*/

var double = "double";
var single = 'single';
var backtick = `backtick`;    // ES6 only

Each of these lines creates a string and, in some cases, can be used interchangeably. The choice of how to define strings in a codebase is a stylistic one outside of template literals (which allow embedded of expressions to be interpreted).

Many codebases require strings to be defined in a consistent manner.

Rule Details

This rule enforces the consistent use of either backticks, double, or single quotes.

Options

This rule has two options, a string option and an object option.

String option:

  • "double" (default) requires the use of double quotes wherever possible
  • "single" requires the use of single quotes wherever possible
  • "backtick" requires the use of backticks wherever possible

Object option:

  • "avoidEscape": true allows strings to use single-quotes or double-quotes so long as the string contains a quote that would have to be escaped otherwise
  • "allowTemplateLiterals": true allows strings to use backticks

Deprecated: The object property avoid-escape is deprecated; please use the object property avoidEscape instead.

double

Examples of incorrect code for this rule with the default "double" option:

/*eslint quotes: ["error", "double"]*/

var single = 'single';
var unescaped = 'a string containing "double" quotes';

Examples of correct code for this rule with the default "double" option:

/*eslint quotes: ["error", "double"]*/
/*eslint-env es6*/

var double = "double";
var backtick = `back\ntick`;  // backticks are allowed due to newline
var backtick = tag`backtick`; // backticks are allowed due to tag

single

Examples of incorrect code for this rule with the "single" option:

/*eslint quotes: ["error", "single"]*/

var double = "double";
var unescaped = "a string containing 'single' quotes";

Examples of correct code for this rule with the "single" option:

/*eslint quotes: ["error", "single"]*/
/*eslint-env es6*/

var single = 'single';
var backtick = `back${x}tick`; // backticks are allowed due to substitution

backticks

Examples of incorrect code for this rule with the "backtick" option:

/*eslint quotes: ["error", "backtick"]*/

var single = 'single';
var double = "double";
var unescaped = 'a string containing `backticks`';

Examples of correct code for this rule with the "backtick" option:

/*eslint quotes: ["error", "backtick"]*/
/*eslint-env es6*/

var backtick = `backtick`;

avoidEscape

Examples of additional correct code for this rule with the "double", { "avoidEscape": true } options:

/*eslint quotes: ["error", "double", { "avoidEscape": true }]*/

var single = 'a string containing "double" quotes';

Examples of additional correct code for this rule with the "single", { "avoidEscape": true } options:

/*eslint quotes: ["error", "single", { "avoidEscape": true }]*/

var double = "a string containing 'single' quotes";

Examples of additional correct code for this rule with the "backtick", { "avoidEscape": true } options:

/*eslint quotes: ["error", "backtick", { "avoidEscape": true }]*/

var double = "a string containing `backtick` quotes"

allowTemplateLiterals

Examples of additional correct code for this rule with the "double", { "allowTemplateLiterals": true } options:

/*eslint quotes: ["error", "double", { "allowTemplateLiterals": true }]*/

var double = "double";
var double = `double`;

Examples of additional correct code for this rule with the "single", { "allowTemplateLiterals": true } options:

/*eslint quotes: ["error", "single", { "allowTemplateLiterals": true }]*/

var single = 'single';
var single = `single`;

When Not To Use It

If you do not need consistency in your string styles, you can safely disable this rule. Source: http://eslint.org/docs/rules/

Strings must use singlequote.
Open

        midas.visualize.renderers.js = new JavaScriptRenderer("jsRenderer", "/PWService");

enforce the consistent use of either backticks, double, or single quotes (quotes)

JavaScript allows you to define strings in one of three ways: double quotes, single quotes, and backticks (as of ECMAScript 6). For example:

/*eslint-env es6*/

var double = "double";
var single = 'single';
var backtick = `backtick`;    // ES6 only

Each of these lines creates a string and, in some cases, can be used interchangeably. The choice of how to define strings in a codebase is a stylistic one outside of template literals (which allow embedded of expressions to be interpreted).

Many codebases require strings to be defined in a consistent manner.

Rule Details

This rule enforces the consistent use of either backticks, double, or single quotes.

Options

This rule has two options, a string option and an object option.

String option:

  • "double" (default) requires the use of double quotes wherever possible
  • "single" requires the use of single quotes wherever possible
  • "backtick" requires the use of backticks wherever possible

Object option:

  • "avoidEscape": true allows strings to use single-quotes or double-quotes so long as the string contains a quote that would have to be escaped otherwise
  • "allowTemplateLiterals": true allows strings to use backticks

Deprecated: The object property avoid-escape is deprecated; please use the object property avoidEscape instead.

double

Examples of incorrect code for this rule with the default "double" option:

/*eslint quotes: ["error", "double"]*/

var single = 'single';
var unescaped = 'a string containing "double" quotes';

Examples of correct code for this rule with the default "double" option:

/*eslint quotes: ["error", "double"]*/
/*eslint-env es6*/

var double = "double";
var backtick = `back\ntick`;  // backticks are allowed due to newline
var backtick = tag`backtick`; // backticks are allowed due to tag

single

Examples of incorrect code for this rule with the "single" option:

/*eslint quotes: ["error", "single"]*/

var double = "double";
var unescaped = "a string containing 'single' quotes";

Examples of correct code for this rule with the "single" option:

/*eslint quotes: ["error", "single"]*/
/*eslint-env es6*/

var single = 'single';
var backtick = `back${x}tick`; // backticks are allowed due to substitution

backticks

Examples of incorrect code for this rule with the "backtick" option:

/*eslint quotes: ["error", "backtick"]*/

var single = 'single';
var double = "double";
var unescaped = 'a string containing `backticks`';

Examples of correct code for this rule with the "backtick" option:

/*eslint quotes: ["error", "backtick"]*/
/*eslint-env es6*/

var backtick = `backtick`;

avoidEscape

Examples of additional correct code for this rule with the "double", { "avoidEscape": true } options:

/*eslint quotes: ["error", "double", { "avoidEscape": true }]*/

var single = 'a string containing "double" quotes';

Examples of additional correct code for this rule with the "single", { "avoidEscape": true } options:

/*eslint quotes: ["error", "single", { "avoidEscape": true }]*/

var double = "a string containing 'single' quotes";

Examples of additional correct code for this rule with the "backtick", { "avoidEscape": true } options:

/*eslint quotes: ["error", "backtick", { "avoidEscape": true }]*/

var double = "a string containing `backtick` quotes"

allowTemplateLiterals

Examples of additional correct code for this rule with the "double", { "allowTemplateLiterals": true } options:

/*eslint quotes: ["error", "double", { "allowTemplateLiterals": true }]*/

var double = "double";
var double = `double`;

Examples of additional correct code for this rule with the "single", { "allowTemplateLiterals": true } options:

/*eslint quotes: ["error", "single", { "allowTemplateLiterals": true }]*/

var single = 'single';
var single = `single`;

When Not To Use It

If you do not need consistency in your string styles, you can safely disable this rule. Source: http://eslint.org/docs/rules/

'Paraview' is not defined.
Open

    paraview = new Paraview("/PWService");

Disallow Undeclared Variables (no-undef)

This rule can help you locate potential ReferenceErrors resulting from misspellings of variable and parameter names, or accidental implicit globals (for example, from forgetting the var keyword in a for loop initializer).

Rule Details

Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a /*global ...*/ comment.

Examples of incorrect code for this rule:

/*eslint no-undef: "error"*/

var a = someFunction();
b = 10;

Examples of correct code for this rule with global declaration:

/*global someFunction b:true*/
/*eslint no-undef: "error"*/

var a = someFunction();
b = 10;

The b:true syntax in /*global */ indicates that assignment to b is correct.

Examples of incorrect code for this rule with global declaration:

/*global b*/
/*eslint no-undef: "error"*/

b = 10;

By default, variables declared in /*global */ are read-only, therefore assignment is incorrect.

Options

  • typeof set to true will warn for variables used inside typeof check (Default false).

typeof

Examples of correct code for the default { "typeof": false } option:

/*eslint no-undef: "error"*/

if (typeof UndefinedIdentifier === "undefined") {
    // do something ...
}

You can use this option if you want to prevent typeof check on a variable which has not been declared.

Examples of incorrect code for the { "typeof": true } option:

/*eslint no-undef: ["error", { "typeof": true }] */

if(typeof a === "string"){}

Examples of correct code for the { "typeof": true } option with global declaration:

/*global a*/
/*eslint no-undef: ["error", { "typeof": true }] */

if(typeof a === "string"){}

Environments

For convenience, ESLint provides shortcuts that pre-define global variables exposed by popular libraries and runtime environments. This rule supports these environments, as listed in Specifying Environments. A few examples are given below.

browser

Examples of correct code for this rule with browser environment:

/*eslint no-undef: "error"*/
/*eslint-env browser*/

setTimeout(function() {
    alert("Hello");
});

node

Examples of correct code for this rule with node environment:

/*eslint no-undef: "error"*/
/*eslint-env node*/

var fs = require("fs");
module.exports = function() {
    console.log(fs);
};

When Not To Use It

If explicit declaration of global variables is not to your taste.

Compatibility

This rule provides compatibility with treatment of global variables in JSHint and JSLint. Source: http://eslint.org/docs/rules/

Read-only global 'json' should not be modified.
Open

    json = $.parseJSON($('div.jsonContent').html());

Disallow assignment to native objects or read-only global variables (no-global-assign)

JavaScript environments contain a number of built-in global variables, such as window in browsers and process in Node.js. In almost all cases, you don't want to assign a value to these global variables as doing so could result in losing access to important functionality. For example, you probably don't want to do this in browser code:

window = {};

While examples such as window are obvious, there are often hundreds of built-in global objects provided by JavaScript environments. It can be hard to know if you're assigning to a global variable or not.

Rule Details

This rule disallows modifications to read-only global variables.

ESLint has the capability to configure global variables as read-only.

  • [Specifying Environments](../user-guide/configuring#specifying-environments)
  • [Specifying Globals](../user-guide/configuring#specifying-globals)

Examples of incorrect code for this rule:

/*eslint no-global-assign: "error"*/

Object = null
undefined = 1
/*eslint no-global-assign: "error"*/
/*eslint-env browser*/

window = {}
length = 1
top = 1
/*eslint no-global-assign: "error"*/
/*globals a:false*/

a = 1

Examples of correct code for this rule:

/*eslint no-global-assign: "error"*/

a = 1
var b = 1
b = 2
/*eslint no-global-assign: "error"*/
/*eslint-env browser*/

onload = function() {}
/*eslint no-global-assign: "error"*/
/*globals a:true*/

a = 1

Options

This rule accepts an exceptions option, which can be used to specify a list of builtins for which reassignments will be allowed:

{
    "rules": {
        "no-global-assign": ["error", {"exceptions": ["Object"]}]
    }
}

When Not To Use It

If you are trying to override one of the native objects.

Related Rules

Similar blocks of code found in 2 locations. Consider refactoring.
Open

midas.visualize.setupExtractSubgrid = function () {
    'use strict';
    var dialog = $('#extractSubgridDialogTemplate').clone();
    dialog.removeAttr('id');
    $('#extractSubgridAction').click(function () {
Severity: Major
Found in modules/visualize/public/js/paraview/paraview.volume.js and 1 other location - About 1 wk to fix
modules/pvw/public/js/paraview/paraview.volume.js on lines 444..539

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 1613.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

midas.visualize.setupSofPlotBindings = function () {
    'use strict';
    // Clicking an existing point should let you change its values
    $('#sofChartDiv').bind('jqplotDataClick', function (ev, seriesIndex, pointIndex, data) {
        var container = $('div.MainDialog').find('div.sofPointEdit');
Severity: Major
Found in modules/visualize/public/js/paraview/paraview.volume.js and 1 other location - About 4 days to fix
modules/pvw/public/js/paraview/paraview.volume.js on lines 392..439

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 732.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

midas.visualize.switchRenderer = function (first) {
    'use strict';
    if (midas.visualize.renderers.js === undefined) {
        midas.visualize.renderers.js = new JavaScriptRenderer("jsRenderer", "/PWService");
        midas.visualize.renderers.js.enableWebSocket(paraview, 'ws://' + json.visualize.hostname + ':' + json.visualize.wsport + '/PWService/Websocket');
Severity: Major
Found in modules/visualize/public/js/paraview/paraview.volume.js and 1 other location - About 1 day to fix
modules/visualize/public/js/paraview/paraview.slice.js on lines 246..263

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 338.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

midas.visualize.populateInfo = function () {
    'use strict';
    $('#boundsXInfo').html(midas.visualize.bounds[0] + ' .. ' + midas.visualize.bounds[1]);
    $('#boundsYInfo').html(midas.visualize.bounds[2] + ' .. ' + midas.visualize.bounds[3]);
    $('#boundsZInfo').html(midas.visualize.bounds[4] + ' .. ' + midas.visualize.bounds[5]);
Severity: Major
Found in modules/visualize/public/js/paraview/paraview.volume.js and 1 other location - About 1 day to fix
modules/visualize/public/js/paraview/paraview.slice.js on lines 171..177

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 203.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

            $.each(pointListDiv.find('div.rgbPointContainer'), function (idx, template) {
                var scalar = parseFloat($(template).find('input.scmScalarValue').val());
                var tokens = $(template).find('div.scmColorPicker')
                    .css('background-color').match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
                colorMap.push(scalar, parseFloat(tokens[1]) / 255.0, parseFloat(tokens[2]) / 255.0,
Severity: Major
Found in modules/visualize/public/js/paraview/paraview.volume.js and 1 other location - About 5 hrs to fix
modules/pvw/public/js/paraview/paraview.volume.js on lines 265..271

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 142.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    $('button.plusY').click(function () {
        paraview.callPluginMethod('midascommon', 'SetCamera', {
            cameraPosition: [
                midas.visualize.midI,
                midas.visualize.midJ - midas.visualize.DISTANCE_FACTOR * midas.visualize.maxDim,
Severity: Major
Found in modules/visualize/public/js/paraview/paraview.volume.js and 1 other location - About 4 hrs to fix
modules/visualize/public/js/paraview/paraview.volume.js on lines 651..662

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 120.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    $('button.plusX').click(function () {
        paraview.callPluginMethod('midascommon', 'SetCamera', {
            cameraPosition: [
                midas.visualize.midI - midas.visualize.DISTANCE_FACTOR * midas.visualize.maxDim,
                midas.visualize.midJ,
Severity: Major
Found in modules/visualize/public/js/paraview/paraview.volume.js and 1 other location - About 4 hrs to fix
modules/visualize/public/js/paraview/paraview.volume.js on lines 627..638

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 120.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    $('button.minusX').click(function () {
        paraview.callPluginMethod('midascommon', 'SetCamera', {
            cameraPosition: [
                midas.visualize.midI + midas.visualize.DISTANCE_FACTOR * midas.visualize.maxDim,
                midas.visualize.midJ,
Severity: Major
Found in modules/visualize/public/js/paraview/paraview.volume.js and 1 other location - About 4 hrs to fix
modules/visualize/public/js/paraview/paraview.volume.js on lines 615..626

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 120.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    $('button.plusZ').click(function () {
        paraview.callPluginMethod('midascommon', 'SetCamera', {
            cameraPosition: [
                midas.visualize.midI,
                midas.visualize.midJ,
Severity: Major
Found in modules/visualize/public/js/paraview/paraview.volume.js and 1 other location - About 4 hrs to fix
modules/visualize/public/js/paraview/paraview.volume.js on lines 675..686

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 120.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    $('button.minusY').click(function () {
        paraview.callPluginMethod('midascommon', 'SetCamera', {
            cameraPosition: [
                midas.visualize.midI,
                midas.visualize.midJ + midas.visualize.DISTANCE_FACTOR * midas.visualize.maxDim,
Severity: Major
Found in modules/visualize/public/js/paraview/paraview.volume.js and 1 other location - About 4 hrs to fix
modules/visualize/public/js/paraview/paraview.volume.js on lines 639..650

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 120.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    $('button.minusZ').click(function () {
        paraview.callPluginMethod('midascommon', 'SetCamera', {
            cameraPosition: [
                midas.visualize.midI,
                midas.visualize.midJ,
Severity: Major
Found in modules/visualize/public/js/paraview/paraview.volume.js and 1 other location - About 4 hrs to fix
modules/visualize/public/js/paraview/paraview.volume.js on lines 663..674

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 120.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    midas.visualize.maxDim = Math.max(midas.visualize.bounds[1] - midas.visualize.bounds[0],
        midas.visualize.bounds[3] - midas.visualize.bounds[2],
        midas.visualize.bounds[5] - midas.visualize.bounds[4]);
Severity: Major
Found in modules/visualize/public/js/paraview/paraview.volume.js and 1 other location - About 3 hrs to fix
modules/visualize/public/js/paraview/paraview.slice.js on lines 52..54

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 109.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    paraview.createSessionAsync('midas', 'volume render', 'default', function () {
        $('#loadingStatus').html('Reading image data from files...');
        paraview.callPluginMethod('midascommon', 'OpenData', {
            filename: json.visualize.url,
            otherMeshes: json.visualize.meshes
Severity: Major
Found in modules/visualize/public/js/paraview/paraview.volume.js and 1 other location - About 2 hrs to fix
modules/visualize/public/js/paraview/paraview.slice.js on lines 36..42

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 83.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                onSubmit: function (hsb, hex, rgb, el) {
                    $(el).css('background-color', 'rgb(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ')');
                }
Severity: Major
Found in modules/visualize/public/js/paraview/paraview.volume.js and 1 other location - About 1 hr to fix
modules/visualize/public/js/paraview/paraview.volume.js on lines 309..311

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 66.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                    onSubmit: function (hsb, hex, rgb, el) {
                        $(el).css('background-color', 'rgb(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ')');
                    }
Severity: Major
Found in modules/visualize/public/js/paraview/paraview.volume.js and 1 other location - About 1 hr to fix
modules/visualize/public/js/paraview/paraview.volume.js on lines 331..333

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 66.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    for (var i = 0; i < points.length; i++) {
        curve[i] = [points[4 * i], points[4 * i + 1]];
    }
Severity: Major
Found in modules/visualize/public/js/paraview/paraview.volume.js and 1 other location - About 1 hr to fix
modules/pvw/public/js/paraview/paraview.volume.js on lines 362..364

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 61.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                yaxis: {
                    min: 0,
                    max: 1,
                    label: 'Opacity',
                    labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
Severity: Major
Found in modules/visualize/public/js/paraview/paraview.volume.js and 1 other location - About 1 hr to fix
modules/pvw/public/js/paraview/paraview.volume.js on lines 312..322

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 55.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    midas.visualize.midK = Math.floor((midas.visualize.bounds[4] + midas.visualize.bounds[5]) / 2.0);
Severity: Major
Found in modules/visualize/public/js/paraview/paraview.volume.js and 1 other location - About 1 hr to fix
modules/visualize/public/js/paraview/paraview.slice.js on lines 61..61

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 55.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                    rgbPoint.find('button.scmDeletePoint').show().click(function () {
                        $(this).parents('div.rgbPointContainer').remove();
                    });
Severity: Minor
Found in modules/visualize/public/js/paraview/paraview.volume.js and 1 other location - About 55 mins to fix
modules/pvw/public/js/paraview/paraview.volume.js on lines 217..219

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 53.

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

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    midas.visualize.midJ = (midas.visualize.bounds[2] + midas.visualize.bounds[3]) / 2.0;
Severity: Major
Found in modules/visualize/public/js/paraview/paraview.volume.js and 3 other locations - About 35 mins to fix
modules/visualize/public/js/paraview/paraview.slice.js on lines 59..59
modules/visualize/public/js/paraview/paraview.slice.js on lines 60..60
modules/visualize/public/js/paraview/paraview.volume.js on lines 56..56

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 47.

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

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    midas.visualize.midI = (midas.visualize.bounds[0] + midas.visualize.bounds[1]) / 2.0;
Severity: Major
Found in modules/visualize/public/js/paraview/paraview.volume.js and 3 other locations - About 35 mins to fix
modules/visualize/public/js/paraview/paraview.slice.js on lines 59..59
modules/visualize/public/js/paraview/paraview.slice.js on lines 60..60
modules/visualize/public/js/paraview/paraview.volume.js on lines 57..57

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 47.

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

Further Reading

Identical blocks of code found in 3 locations. Consider refactoring.
Open

    paraview.errorListener = {
        manageError: function (error) {
            if (error) {
                midas.createNotice('A ParaViewWeb error occurred.', 4000, 'error');
                return false;
Severity: Minor
Found in modules/visualize/public/js/paraview/paraview.volume.js and 2 other locations - About 35 mins to fix
modules/visualize/public/js/paraview/paraview.slice.js on lines 27..34
modules/visualize/public/js/paraview/paraview.surface.js on lines 24..31

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 46.

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

Further Reading

There are no issues that match your filters.

Category
Status