Showing 6 of 12 total issues
Function exports
has 230 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
'use strict';
var fs = require('fs');
var symlink = fs.symlink;
Function hashMissing
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
sockets.admin.hashMissing = function(socket, cb) {
async.parallel({
postIds: function(next) {
db.getSortedSetRevRange('posts:pid', 0, -1, next);
},
Function renderAdmin
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function renderAdmin(req, res, next) {
async.parallel({
postCount: function(next) {
db.sortedSetCard('posts:pid', next);
},
Function resolveHash
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
hashing.resolveHash = function(req, res, cb) {
var hash = req.params.hash;
async.parallel({
isPost: function(next) {
Function parseAjaxifyData
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parseAjaxifyData() {
var data = ajaxify.data;
var dataKey = data.topics ? 'topics' : data.categories ? 'categories' : null;
var pageData = dataKey ? data[dataKey] : void 0;
var hashedObjects = {
Function parseBools
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
function parseBools(obj) {
for (var name in obj) {
if (obj.hasOwnProperty(name)) {
if (obj[name] === 'true') obj[name] = true;
if (obj[name] === 'false') obj[name] = false;
- 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"