Showing 14 of 14 total issues
Function validateServiceOptions
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
export function validateServiceOptions (opts = {}) {
if (!opts.expectedPeerCount) opts.expectedPeerCount = 3
if (!opts.expectedDiskCount) opts.expectedDiskCount = 3
if (!opts.expectedHostCount) opts.expectedHostCount = 3
if (!opts.expectedGroupCount) opts.expectedGroupCount = 3
- 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 validateServiceOptions
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function validateServiceOptions (opts = {}) {
if (!opts.expectedPeerCount) opts.expectedPeerCount = 3
if (!opts.expectedDiskCount) opts.expectedDiskCount = 3
if (!opts.expectedHostCount) opts.expectedHostCount = 3
if (!opts.expectedGroupCount) opts.expectedGroupCount = 3
Avoid deeply nested control flow statements. Open
if (!opts.peers.redis.key) opts.peers.redis.key = '__EruDB_discovery'
Import in body of module; reorder to top. Open
import sourcemaps from 'gulp-sourcemaps'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Import in body of module; reorder to top. Open
import prepend from 'prepend-file'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Import in body of module; reorder to top. Open
import mocha from 'gulp-mocha'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Unexpected tab character. Open
.pipe(babel({ presets: [ 'es2015' ] }))
- Read upRead up
- Exclude checks
disallow all tabs (no-tabs)
Some style guides don't allow the use of tab characters at all, including within comments.
Rule Details
This rule looks for tabs anywhere inside a file: code, comments or anything else.
Examples of incorrect code for this rule:
var a /t= 2;
/**
* /t/t it's a test function
*/
function test(){}
var x = 1; // /t test
Examples of correct code for this rule:
var a = 2;
/**
* it's a test function
*/
function test(){}
var x = 1; // test
When Not To Use It
If you have established a standard where having tabs is fine.
Compatibility
- JSCS: disallowTabs Source: http://eslint.org/docs/rules/
Import in body of module; reorder to top. Open
import eslint from 'gulp-eslint'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Import in body of module; reorder to top. Open
import fs from 'fs'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Import in body of module; reorder to top. Open
import del from 'del'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Unexpected tab character. Open
.pipe(gulp.dest(DEST))
- Read upRead up
- Exclude checks
disallow all tabs (no-tabs)
Some style guides don't allow the use of tab characters at all, including within comments.
Rule Details
This rule looks for tabs anywhere inside a file: code, comments or anything else.
Examples of incorrect code for this rule:
var a /t= 2;
/**
* /t/t it's a test function
*/
function test(){}
var x = 1; // /t test
Examples of correct code for this rule:
var a = 2;
/**
* it's a test function
*/
function test(){}
var x = 1; // test
When Not To Use It
If you have established a standard where having tabs is fine.
Compatibility
- JSCS: disallowTabs Source: http://eslint.org/docs/rules/
Import in body of module; reorder to top. Open
import server from 'gulp-develop-server'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Import in body of module; reorder to top. Open
import gulp from 'gulp'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Import in body of module; reorder to top. Open
import babel from 'gulp-babel'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/