Showing 38 of 88 total issues
Function default
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export default function (options) {
return function ask (files, metalsmith, done) {
const metadata = metalsmith.metadata();
const data = Object.assign({}, metadata);
- 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 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function middleware (options) {
return function mount (files, metalsmith, done) {
// if not mounting, skip
if (!options.mount) {
return done(null);
Function default
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export default function (options) {
return function feathersJSON (files, metalsmith, done) {
const meta = metalsmith.metadata();
const { name, providers, cors, whitelist } = meta.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 mount
has 63 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 a Cognitive Complexity of 17 (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, providers, cors} = 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 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (options) {
return function feathersJSON (files, metalsmith, done) {
const meta = metalsmith.metadata();
const { name, providers, cors, whitelist } = meta.answers;
Function feathersJSON
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function feathersJSON (files, metalsmith, done) {
const meta = metalsmith.metadata();
const { name, providers, cors, whitelist } = meta.answers;
const existing = meta.feathers;
let template = files['src/feathers.json'];
Function default
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (options) {
return function ask (files, metalsmith, done) {
const metadata = metalsmith.metadata();
const data = Object.assign({}, metadata);
Function default
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (prompt, done, options) {
const metalsmith = Metalsmith(TEMPLATE_PATH);
metalsmith
.metadata({ options })
Function ask
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function ask (files, metalsmith, done) {
const metadata = metalsmith.metadata();
const data = Object.assign({}, metadata);
try {
Function default
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (prompt, done, options) {
const metalsmith = Metalsmith(TEMPLATE_PATH);
const SERVICE_PATH = path.resolve(options.path);
const FEATHERS_PATH = 'src/feathers.json';
const MOUNT_PATH = options.mount || 'src/feathers.json';
Function default
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (prompt, done, options) {
const metalsmith = Metalsmith(TEMPLATE_PATH);
const SERVICE_PATH = path.resolve(options.path);
const FEATHERS_PATH = 'src/feathers.json';
const MOUNT_PATH = options.mount || 'src/feathers.json';
Function default
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (prompt, done, options) {
const metalsmith = Metalsmith(TEMPLATE_PATH);
const SERVICE_PATH = path.resolve(options.path);
const FEATHERS_PATH = 'src/feathers.json';
const MOUNT_PATH = options.mount || 'src/feathers.json';
Function default
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (prompt, done, options) {
const metalsmith = Metalsmith(TEMPLATE_PATH);
const SERVICE_PATH = path.resolve(options.path);
const FEATHERS_PATH = 'src/feathers.json';
const MOUNT_PATH = options.mount || 'src/feathers.json';
Function hooks
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function hooks (options) {
return function mount (files, metalsmith, done) {
// if not mounting, skip
if (!options.mount) {
return done(null);
Function default
has 42 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, providers, cors} = metadata.answers;
Function default
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (prompt, done, options) {
const metalsmith = Metalsmith(TEMPLATE_PATH);
metalsmith
.metadata({ options })
Function packageJSON
has 40 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, providers, cors} = metadata.answers;
const meta = metadata.meta;
Function mount
has 40 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 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (prompt, done, options) {
const metalsmith = Metalsmith(TEMPLATE_PATH);
const MOUNT_PATH = options.mount || 'src/feathers.json';
const CONFIG_PATH = options.config || 'config';