Showing 6 of 21 total issues
File schema-manager.js
has 316 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const { capitalize, omit, pick } = require('./utils/lodash-natives');
const StrategyInterface = require('./strategy-interface');
const TypeMapper = require('./type-mapper');
const { checkTypeOptional, checkTypeRequired } = require('./utils/type-checks');
SchemaManager
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class SchemaManager {
/**
* @param {object} options User options.
* @param {string} options.baseUri Base URI prefixed to generated paths, defaults to '/'
* @param {boolean} options.absolutePaths False to generate relative paths, defaults to true
Function map
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
map(attributeName, properties, strategy) {
let result;
let attributeType = properties && properties.type && properties.type.key;
// Aliases
- 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 generate
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
generate(model, strategy, options) {
const defaultOptions = {
title: null,
description: null,
include: [],
Function _getModelPropertyForAssociation
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_getModelPropertyForAssociation(associationName, association) {
const options = _modelOptions.get(this);
if (
options.excludeAssociations.length > 0 &&
Function generate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
generate(model, strategy, options) {
const defaultOptions = {
title: null,
description: null,
include: [],
- 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"