Showing 300 of 300 total issues
Function controller
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
controller: function () {
'use strict';
var ctrl = this;
var heatmapColorPatternDefaults = ['#d4f0fa', '#F9D67A', '#EC7A08', '#CE0000'];
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function controller
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
controller: function ($scope) {
'use strict';
var ctrl = this;
ctrl.$onInit = function () {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function controller
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
controller: function () {
'use strict';
var ctrl = this;
var prevConfig;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function controller
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
controller: function ( $uibModal ) {
'use strict';
var ctrl = this;
var modalInstance;
- 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 Factory
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Factory ($rootScope) {
//
// Element that the mouse capture applies to, defaults to 'document'
// unless the 'mouse-capture' directive is used.
//
Function ZoomViewModel
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
pfCanvas.ZoomViewModel = function() {
this.max = 1; // Max zoom level
this.min = parseFloat(".5"); // Min zoom level
this.inc = parseFloat(".25"); // Zoom level increment
this.level = this.max; // Zoom level
Function $onInit
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
ctrl.$onInit = function () {
firstRun = true;
ctrl.steps = [];
ctrl.context = {};
ctrl.hideHeader = ctrl.hideHeader === 'true';
Function goTo
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
ctrl.goTo = function (step) {
var focusElement = null;
if (ctrl.wizard.isWizardDone() || !step.okToNavAway || step === ctrl.selectedStep) {
return;
Function $onInit
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
ctrl.$onInit = function () {
ctrl.modalId = ctrl.resolve.modalId;
ctrl.titleId = ctrl.resolve.titleId || "modalTitle";
ctrl.modalTitle = ctrl.resolve.modalTitle;
ctrl.hideCloseIcon = ctrl.resolve.hideCloseIcon || false;
Function ConnectorViewModel
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
pfCanvas.ConnectorViewModel = function(connectorDataModel, x, y, parentNode) {
this.data = connectorDataModel;
this._parentNode = parentNode;
this._x = x;
Consider simplifying this complex logical expression. Open
if (step.allowClickNav &&
ctrl.selectedStep &&
!ctrl.wizardDone &&
ctrl.selectedStep.okToNavAway &&
(ctrl.selectedStep.nextEnabled || (step.stepPriority < ctrl.selectedStep.stepPriority)) &&
Function drawEdges
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
ctrl.drawEdges = function () {
var quadtree = d3.geom.quadtree(ctrl.force.nodes());
ctrl.context.strokeStyle = 'rgba(150, 150, 150, 0.6)';
ctrl.context.lineWidth = 1;
ctrl.edges.forEach(function (d) {
Function link
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function ($scope, $element, $attrs, controller, $transclude) {
var iChildScope;
var iScopeType;
if (!$transclude) {
Function updateConfigOptions
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
ctrl.updateConfigOptions = function () {
var props = "";
if (ctrl.debug) {
$log.debug(" updateConfigOptions");
Similar blocks of code found in 3 locations. Consider refactoring. Open
if (ctrl.blockPadding === undefined || isNaN(ctrl.blockPadding)) {
ctrl.padding = 2;
} else {
ctrl.padding = parseInt(ctrl.blockPadding);
}
- 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 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
- 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 3 locations. Consider refactoring. Open
if (ctrl.rangeHoverSize === undefined || isNaN(ctrl.rangeHoverSize)) {
ctrl.rangeHoverSize = 15;
} else {
ctrl.rangeHoverSize = parseInt(ctrl.rangeHoverSize);
}
- 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 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
- 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 3 locations. Consider refactoring. Open
if (ctrl.minBlockSize === undefined || isNaN(ctrl.minBlockSize)) {
ctrl.minSize = 2;
} else {
ctrl.minSize = parseInt(ctrl.minBlockSize);
}
- 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 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
- 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 click
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function click () {
var node;
var edge;
var addKey = ctrl.ctrlKey();
if (d3.event.defaultPrevented) {
Function link
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function ($scope, $element, $attributes) {
var charsMaxLimit = $attributes.charsMaxLimit;
var charsWarnRemaining = $attributes.charsWarnRemaining;
var countRemainingFld = angular.element(document.getElementById($attributes.countFld));
var blockInputAtMaxLimit = ($attributes.blockInputAtMaxLimit === 'true');
Function controller
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
controller: function () {
'use strict';
var ctrl = this;
var heatmapColorPatternDefaults = ['#d4f0fa', '#F9D67A', '#EC7A08', '#CE0000'];