Showing 13 of 13 total issues
File page.js
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict'
const lockfile = require('lockfile')
const fs = require('fs-extra')
const readline = require('readline')
Function install
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
exports.install = () => {
/**
* @function normalize
* Normalizes the given url to a standardized format.
*
- 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 install
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
exports.install = opts => {
frameworkEngine = global.Controller.prototype.view
/* eslint complexity: 0 */
global.Controller.prototype.view = function (name, model = { }, headers, isPartial) {
// shift arguments if needed
- 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 install
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.install = () => {
/**
* @function normalize
* Normalizes the given url to a standardized format.
*
Function install
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.install = opts => {
frameworkEngine = global.Controller.prototype.view
/* eslint complexity: 0 */
global.Controller.prototype.view = function (name, model = { }, headers, isPartial) {
// shift arguments if needed
Function view
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
global.Controller.prototype.view = function (name, model = { }, headers, isPartial) {
// shift arguments if needed
if (isPartial === undefined && typeof headers === 'boolean') {
isPartial = headers
headers = null
Function buildIndex
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.buildIndex = () => {
const cached = F.cache.get(INDEX_KEY)
if (!F.isDebug && cached) return q(cached)
const deferred = q.defer()
Function install
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.install = () => {
let deferred = q.defer()
F.path.wiki = (p = '') => { return F.path.root(path.join(F.isTest ? 'wiki.test' : 'wiki', p)) }
try {
Function parseDocument
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.parseDocument = doc => {
if (typeof doc === 'string') {
let bodyMatch = /(?:^|\n)[^$]/.exec(doc)
if (!bodyMatch) return q('')
let body = doc.substring(bodyMatch.index)
Avoid too many return
statements within this function. Open
else return 'white'
Function install
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
exports.install = () => {
let deferred = q.defer()
F.path.wiki = (p = '') => { return F.path.root(path.join(F.isTest ? 'wiki.test' : 'wiki', p)) }
try {
- 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 compileTarget
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function compileTarget (req, res, isValidation) {
if (isValidation) return req.url.endsWith('.scss') || req.url.endsWith('.sass')
else if (!compileTarget(req, res, true)) return false
// try to load from cache if present.
- 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 parseDocument
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
exports.parseDocument = doc => {
if (typeof doc === 'string') {
let bodyMatch = /(?:^|\n)[^$]/.exec(doc)
if (!bodyMatch) return q('')
let body = doc.substring(bodyMatch.index)
- 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"