Function validate
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
validate: function (formAttrs) {
var errors = {};
var parsedAttrs = this.parse(formAttrs);
var params = this.paramsForType(formAttrs.type);
- 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 parse
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
parse: function (formAttrs) {
var parsedAttrs = _.extend({}, formAttrs);
var params = this.paramsForType(formAttrs.type);
for (var name in params) {
- 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 validate
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
validate: function (formAttrs) {
var errors = {};
var parsedAttrs = this.parse(formAttrs);
var params = this.paramsForType(formAttrs.type);
Function parse
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
parse: function (formAttrs) {
var parsedAttrs = _.extend({}, formAttrs);
var params = this.paramsForType(formAttrs.type);
for (var name in params) {
Function getDefaultCartoCSSForType
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
getDefaultCartoCSSForType: function () {
return _.template([
"#layer['mapnik::geometry_type'=1] {",
' marker-width: <%= point.fill.size.fixed %>;',
' marker-fill: <%= point.fill.color.fixed %>;',
Function getSourceNamesForAnalysisType
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getSourceNamesForAnalysisType: function (type) {
if (!SOURCE_NAMES_MAP[type]) {
var sourceNames = [];
var params = this.paramsForType(type);
- 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"