Showing 28 of 28 total issues
Function register
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
module.exports.register = function(Handlebars, options, params) {
"use strict";
function eachSorted(context, options, sortCallback, filterCallback) {
/*jshint validthis:true */
- 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 getThemeConfig
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function getThemeConfig(grunt, prop, options) {
"use strict";
options = options || {}
- 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 prepareThemes
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function prepareThemes(grunt) {
"use strict";
var happyplan = grunt.config.getRaw('happyplan')
, mergeConfig = require('./merge-config')
- 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 exports
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(grunt) {
"use strict";
var path = require('path')
, codeMirrorHighlight = require('highlight-codemirror')
- 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 exports
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt) {
"use strict";
var path = require('path')
, codeMirrorHighlight = require('highlight-codemirror')
Function prepareThemes
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function prepareThemes(grunt) {
"use strict";
var happyplan = grunt.config.getRaw('happyplan')
, mergeConfig = require('./merge-config')
Function register
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.register = function(Handlebars, options, params) {
"use strict";
function eachSorted(context, options, sortCallback, filterCallback) {
/*jshint validthis:true */
Function getThemeConfig
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function getThemeConfig(grunt, prop, options) {
"use strict";
options = options || {}
Function exports
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt) {
"use strict";
var fs = require('fs')
, path = require('path')
Function exports
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt) {
"use strict";
return {
jsconfig: {
Function exports
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt) {
"use strict";
// Execute or skip 'webfont:glyphicons' depending of the presence of SVG files in the '<%= happyplan.path.assets.glyphicons %>' folder.
grunt.registerTask('happyplan:glyphicons', 'Generate glyphicons if needed', function() {
Function exports
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt) {
"use strict";
function unquote(str) {
if (str.indexOf('"') === 0 && str.lastIndexOf('"') === str.length-1 ||
Function eachSorted
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function eachSorted(context, options, sortCallback, filterCallback) {
/*jshint validthis:true */
var fn = options.fn
, i = 0
Function highlight
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
highlight: function (code, lang) {
if (lang) {
try {
var langs = happyplan.codeHighlightMap[lang] ? happyplan.codeHighlightMap[lang] : [lang]
if (langs.length) {
Function exports
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt) {
"use strict";
// using try instead of a file.exists also handle json parsing error
try {
Function prepareThemes
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function prepareThemes(grunt) {
"use strict";
var happyplan = grunt.config.get('happyplan')
, helpers = grunt.config.getRaw(['happyplan', 'html', 'helpers'])
Function getThemes
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function getThemes(grunt, reverseOrder, raw) {
"use strict";
reverseOrder = reverseOrder === undefined ? true : reverseOrder;
raw = raw === undefined ? false : raw;
Function getThemes
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function getThemes(grunt, reverseOrder, raw) {
"use strict";
reverseOrder = reverseOrder === undefined ? true : reverseOrder;
raw = raw === undefined ? false : raw;
- 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
Avoid deeply nested control flow statements. Open
else if (finalValue) {
//if (value instanceof Array) {
value.push(finalValue)
finalValue = value
// }
Avoid deeply nested control flow statements. Open
if (value instanceof Object) {
for(i in value) {
theme[i] = custom[i]
}
finalValue = value.concat(finalValue)