Showing 124 of 263 total issues
Function Routes
has 242 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function Routes(app, model, Implementation, opts) {
const { modelsManager } = inject();
const modelName = Implementation.getModelName(model);
let integrationInfo;
Function ResourceSerializer
has 176 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ResourceSerializer(
Implementation,
model,
records,
integrator,
Function Associations
has 171 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function Associations(app, model, Implementation, integrator, opts) {
const { modelsManager } = inject();
const modelName = Implementation.getModelName(model);
const schema = Schemas.schemas[modelName];
Function createCollections
has 165 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.createCollections = (Implementation, apimap, collectionAndFieldName) => {
// jshint camelcase: false
const { modelsManager } = inject();
const model = modelsManager.getModels()[collectionAndFieldName.split('.')[0]];
const modelName = Implementation.getModelName(model);
Function perform
has 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.perform = () => {
const typeForAttributes = {};
function getAttributesFor(dest, fields) {
_.map(fields, (field) => {
Function Stats
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function Stats(app, model, Implementation, opts) {
const { chartHandler, modelsManager } = inject();
const modelName = Implementation.getModelName(model);
const permissionMiddlewareCreator = new PermissionMiddlewareCreator(modelName);
- 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 init
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.init = async (Implementation) => {
const { opts } = Implementation;
configStore.Implementation = Implementation;
configStore.lianaOptions = opts;
File index.js
has 390 lines of code (exceeds 250 allowed). Consider refactoring. Open
const _ = require('lodash');
const crypto = require('crypto');
const express = require('express');
const cors = require('cors');
const bodyParser = require('body-parser');
Function Stats
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function Stats(app, model, Implementation, opts) {
const { chartHandler, modelsManager } = inject();
const modelName = Implementation.getModelName(model);
const permissionMiddlewareCreator = new PermissionMiddlewareCreator(modelName);
Function Checker
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
function Checker(opts, Implementation) {
const { modelsManager } = inject();
let integrationValid = false;
function upgradeIntegrationInPlace(stripe) {
- 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 IntercomChecker
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
function IntercomChecker(opts, Implementation) {
const { modelsManager } = inject();
let integrationValid = false;
function hasIntegration() {
- 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 BaseOperatorDateParser
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
function BaseOperatorDateParser(options) {
const offsetClient = Number.parseInt(moment().tz(options.timezone).format('Z'), 10);
const offsetServer = moment().utcOffset() / 60;
this.offsetHours = offsetServer - offsetClient;
Function IntercomChecker
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
function IntercomChecker(opts, Implementation) {
const { modelsManager } = inject();
let integrationValid = false;
function hasIntegration() {
Function ResourceSerializer
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
function ResourceSerializer(
Implementation,
model,
records,
integrator,
- 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 Routes
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function Routes(app, model, Implementation, opts) {
const { modelsManager } = inject();
const modelName = Implementation.getModelName(model);
let integrationInfo;
Function Checker
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Checker(opts, Implementation) {
const { modelsManager } = inject();
let integrationValid = false;
function upgradeIntegrationInPlace(stripe) {
Function SchemaSerializer
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
function SchemaSerializer() {
const { apimapSorter } = inject();
// WARNING: Attributes declaration order is important for .forestadmin-schema.json format.
// It must be ordered by "importance" to ease the JSON reading for users.
const options = {
Function init
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
exports.init = async (Implementation) => {
const { opts } = Implementation;
configStore.Implementation = Implementation;
configStore.lianaOptions = opts;
- 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 SmartFieldsValuesInjector
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
function SmartFieldsValuesInjector(
record,
modelName,
fieldsPerModel,
depth = 0,
- 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 Checker
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
function Checker(options, Implementation) {
const { modelsManager } = inject();
let integrationValid = false;
function hasIntegration() {
- 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"