File pmm-plotter.js
has 1354 lines of code (exceeds 250 allowed). Consider refactoring. Open
pmm_plotter = function() {
/**
* @author Markus Freitag, EITCO GmbH, MFreitag@eitco.de, 2015
*
- Create a ticketCreate a ticket
Function addFunctionFromSelection
has 438 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addFunctionFromSelection(selectedModel,onlySecondaryModel,mode,headless)
{
var manaual = !isRealValue(selectedModel)&&!isRealValue(onlySecondaryModel)&&!isRealValue(mode)
if(manaual){
onlySecondaryModel = _onlySecondaryModel;
- Create a ticketCreate a ticket
Function parseTretiaryModels
has 150 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseTretiaryModels(modelList){
/*
* we use the primary model data as a foundation for the tertiary model
* this applies to the attributes that are equal in all secondary models/data rows
*/
- Create a ticketCreate a ticket
Function addMetaData
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addMetaData(modelObject)
{
/*
* Accordion needs a header followed by a div. We add a paragraph per parameter.
- Create a ticketCreate a ticket
Function updateParameterSliders
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateParameterSliders()
{
var sliderWrapper = document.getElementById("sliderWrapper");
var sliderIds = []; // ids of all sliders that correspond to a constant from the used models
- Create a ticketCreate a ticket
Function parseSecondaryModels
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseSecondaryModels(currentModel,tertiaryModel,headless){
var formulaPrim = currentModel.catalogModel.formula; // main formula is shared
var paramsPrim = currentModel.paramList.params; // so are the primary parameters
var indepsPrim = currentModel.indepList.indeps; // so are the indepdent parameters
var depPrim = currentModel.dep; // so are the primary parameters
- Create a ticketCreate a ticket
Function initLayout
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initLayout()
{
/*
* body
*/
- Create a ticketCreate a ticket
Function resetBinaryFormulaBindings
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
function resetBinaryFormulaBindings(model) {
// not necessary for data points
if(model.fnType == 'points')
return;
- Create a ticketCreate a ticket
Function drawD3Plot
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawD3Plot(headless)
{
// the plot element has to be reset because otherwise functionPlot may draw artifacts
if(!headless){
- Create a ticketCreate a ticket
Function showInputForm
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showInputForm()
{
var svgElement = document.getElementById("d3plotter").firstChild;
var serializer = new XMLSerializer();
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if( (
(indep.min == undefined || indep.min == "" || indep.min == null) &&
(indep.max == undefined || indep.max == "" || indep.max == null) &&
(indep.value != undefined && indep.value !== "")
)
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if( (
(indep.min == undefined || indep.min == "" || indep.min == null) &&
(indep.max == undefined || indep.max == "" || indep.max == null) &&
(indep.value != undefined && indep.value !== "")
)
- Create a ticketCreate a ticket
Function addFunctionObject
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addFunctionObject(dbuuid, functionAsString, functionConstants, model,headless)
{
var color = getNextColor(); // functionPlot provides 9 colors
var maxRange = _plotterValue.maxXAxis * 1000; // obligatoric for the range feature
- Create a ticketCreate a ticket
Function init
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
modelPlotter.init = function(representation, value,headless) {
// view-bug - require js prevents global variable behavior
if (!window.functionPlot) {
if(!headless){
- Create a ticketCreate a ticket
Function prepareParameters
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function prepareParameters(parameterArray, modelId)
{
// this will be returned containing the preprocessed parameters
var newParameterArray = {};
for(index in parameterArray){
- Create a ticketCreate a ticket
Function prepareFunction
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function prepareFunction(parameterArray, functionString, xUnit, yUnit,onlySecondaryModel) {
var newString = functionString;
// cut the left part of the formula
- Create a ticketCreate a ticket
Function initJQuery
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initJQuery()
{
$("#dataChoiceDiv").hide();
$("#graphTypeDiv").hide();
- Create a ticketCreate a ticket
Function deleteFunctionObject
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function deleteFunctionObject(internalId,dbuuid)
{
deleteMetaDataSection(internalId,dbuuid);
removeModel(internalId,dbuuid);
updateParameterSliders();
- Create a ticketCreate a ticket
Function parseModel
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseModel(modelList,onlySecondaryModel)
{
if(onlySecondaryModel){
/*
- Create a ticketCreate a ticket
Function getGlobalxUnit
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getGlobalxUnit(formulaPrim,paramsPrim,indepsPrim,depPrim,secondaryIndeps,secondaryIndepNames,tertiaryModel){
if(!tertiaryModel.m2List){
for(i in indepsPrim){
- Create a ticketCreate a ticket
Function getGlobalxUnit
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function getGlobalxUnit(formulaPrim,paramsPrim,indepsPrim,depPrim,secondaryIndeps,secondaryIndepNames,tertiaryModel){
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if(indep["name"] == parameterPrim)
{
indexToDelete = index;
break;
}
- Create a ticketCreate a ticket
Function prepareFunction
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function prepareFunction(parameterArray, functionString, xUnit, yUnit,onlySecondaryModel) {
- Create a ticketCreate a ticket
Function addFunctionObject
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function addFunctionObject(dbuuid, functionAsString, functionConstants, model,headless)
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
for(index in paramsPrim){
indep = paramsPrim[index];
// convention #1: do not exchange a secondary formula dependent
// convention #2: if a parameter has no mininmum or maximum but a value, it shall not be dynamic
- Read upRead up
- Create a ticketCreate a ticket
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 223.
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
for(index in paramsPrim){
indep = paramsPrim[index];
// convention #1: do not exchange a secondary formula dependent
// convention #2: if a parameter has no mininmum or maximum but a value, it shall not be dynamic
// convention #3: a parameter with "isStart"-Flag shall have a fixed value
- Read upRead up
- Create a ticketCreate a ticket
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 223.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
for(index in secondaryIndeps){
indep = secondaryIndeps[index];
var oldName = indep.name;
var newName = oldName;
- Read upRead up
- Create a ticketCreate a ticket
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 181.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
for(index in secondaryIndeps){
indep = secondaryIndeps[index];
var oldName = indep.name;
var newName = oldName;
var category = indep.category
- Read upRead up
- Create a ticketCreate a ticket
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 181.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
if(timeSeries)
{
for(i2 in timeSeries){
dataPointItem = timeSeries[i2];
var point = [
- Read upRead up
- Create a ticketCreate a ticket
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 57.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
if(timeSeries)
{
for(i2 in timeSeries){
dataPointItem = timeSeries[i2];
- Read upRead up
- Create a ticketCreate a ticket
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 57.
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
$.each(_dbUnits, function (i, dbUnit) {
if(unit == dbUnit.displayInGuiAs)
{
factor = dbUnit.conversionFunctionFactor;
return true;
- Read upRead up
- Create a ticketCreate a ticket
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 48.
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
$.each(_dbUnits, function (i, dbUnit) {
if(unit == dbUnit.displayInGuiAs)
{
factor = dbUnit.inverseConversionFunctionFactor;
return true;
- Read upRead up
- Create a ticketCreate a ticket
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 48.
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