Showing 38 of 88 total issues
Function default
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (options) {
return function packageJSON (files, metalsmith, done) {
const metadata = metalsmith.metadata();
const {name, description} = metadata.options;
const {babel} = metadata.answers;
Function filter
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function filter (options) {
return function mount (files, metalsmith, done) {
// if not mounting, skip
if (!options.mount) {
return done(null);
Function packageJSON
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function packageJSON (files, metalsmith, done) {
const metadata = metalsmith.metadata();
const {name, description} = metadata.options;
const {babel} = metadata.answers;
const meta = metadata.meta;
Function mount
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function mount (files, metalsmith, done) {
// if not mounting, skip
if (!options.mount) {
return done(null);
}
Function default
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (options) {
return function mount (files, metalsmith, done) {
const meta = metalsmith.metadata();
let model = meta.answers.model.template;
Function mount
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function mount (files, metalsmith, done) {
const meta = metalsmith.metadata();
let model = meta.answers.model.template;
let deps = meta.answers.model.deps;
Function services
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function services (options) {
return function rename (files, metalsmith, done) {
const meta = metalsmith.metadata();
// if generating standalone and this is default service, use index
Function questions
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const questions = metadata.meta.prompts.map(prompt => {
const question = Object.assign({}, prompt);
if (!prompt.name) {
throw new Error(`Invalid prompt. You must provide a 'name'. ${prompt}`);
Function plugin
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function plugin (options) {
return function mount (files, metalsmith, done) {
// if not mounting, skip
if (!options.mount) {
return done(null);
Function default
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (options) {
const debug = require('debug')(`feathers:service:${options.table}:postgres`)
const model = client({
Function rename
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function rename (files, metalsmith, done) {
const meta = metalsmith.metadata();
// if generating standalone and this is default service, use index
let index = (path.parse(options.root).name === options.name && options.path === '.');
Function default
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (options) {
const debug = require('debug')(`feathers:service:${options.table}:mysql`)
const model = client({
Function mount
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function mount (files, metalsmith, done) {
// if not mounting, skip
if (!options.mount) {
return done(null);
}
Function default
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (options) {
const debug = require('debug')(`feathers:service:${options.table}:sqlite`)
const model = client({
Function default
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function (options) {
return function configuration (files, metalsmith, done) {
const meta = metalsmith.metadata();
const { whitelist } = meta.answers;
const existing = meta.default;
- 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 default
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function (options) {
return function packageJSON (files, metalsmith, done) {
const metadata = metalsmith.metadata();
const {name, description} = metadata.options;
const {babel} = metadata.answers;
- 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 default
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function (paths) {
return function json (files, metalsmith, done) {
const meta = metalsmith.metadata();
for (let key of Object.keys(paths)) {
- 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 middleware
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function middleware (options) {
return function mount (files, metalsmith, done) {
// if not mounting, skip
if (!options.mount) {
return done(null);
- 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"