Showing 59 of 321 total issues
File ModelDefinition.spec.js
has 1378 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import fixtures from '../../__fixtures__/fixtures'
import { DIRTY_PROPERTY_LIST } from '../ModelBase'
import Model from '../Model'
import ModelDefinitions from '../ModelDefinitions'
import ModelCollectionProperty from '../ModelCollectionProperty'
File Api.spec.js
has 790 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import FormData from 'form-data'
import System from '../../system/System'
import fixtures from '../../__fixtures__/fixtures'
import Api from '../Api'
File ModelBase.spec.js
has 627 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import ModelValidation from '../ModelValidation'
import ModelBase, { DIRTY_PROPERTY_LIST } from '../ModelBase'
jest.mock('../ModelValidation')
Function AnalyticsRequestPropertiesMixin
has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring. Open
Open
const AnalyticsRequestPropertiesMixin = (base) =>
class extends base {
/**
* Sets the query parameters of the request
*
- 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
File System.spec.js
has 560 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import fixtures from '../../__fixtures__/fixtures'
import MockApi from '../../api/Api'
import System from '../System'
import SystemConfiguration from '../SystemConfiguration'
import SystemSettings from '../SystemSettings'
File parser.spec.js
has 517 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { getPeriodFromPeriodId } from '../parser'
function makePeriodFixture(id, name, startDate, endDate, type) {
return { id, name, startDate, endDate, type }
}
File d2.spec.js
has 420 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import Api from '../api/Api'
import fixtures from '../__fixtures__/fixtures'
import I18n from '../i18n/I18n'
import DataStore from '../datastore/DataStore'
import Logger from '../logger/Logger'
File index.spec.js
has 406 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { createPeriodGeneratorsForLocale } from '..'
import * as daily from '../daily'
import * as weekly from '../weekly'
import * as monthly from '../monthly'
import * as bimonthly from '../bi-monthly'
Function request
has 135 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
request(method, url, data, options = {}) {
checkType(method, 'string', 'Request type')
checkType(url, 'string', 'Url')
const api = this
let requestUrl = url
File ModelCollectionProperty.spec.js
has 389 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import fixtures from '../../__fixtures__/fixtures'
import Api from '../../api/Api'
import Model from '../Model'
import ModelDefinition from '../ModelDefinition'
import ModelCollectionProperty from '../ModelCollectionProperty'
File ModelDefinition.js
has 357 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { checkType, isObject, checkDefined, isDefined } from '../lib/check'
import {
addLockedProperty,
curry,
copyOwnProperties,
Function x
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default (function x() {
const fixtures = {}
function getFixture(fixtureName) {
if (fixtures && fixtures[fixtureName]) {
Function init
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function init(initConfig, ApiClass = Api, logger = Logger.getLogger()) {
const api = ApiClass.getApi()
const config = Config.create(preInitConfig, initConfig)
File AnalyticsRequestPropertiesMixin.js
has 327 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint no-console: 0 */
import AnalyticsRequest from './AnalyticsRequest'
/**
File I18n.spec.js
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import MockApi from '../../api/Api'
import I18n from '../I18n'
jest.mock('../../api/Api')
File parser.js
has 302 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
getMonthNamesForLocale,
formatAsISODate,
getLastDateOfMonth,
getFirstDateOfQuarter,
File Model.spec.js
has 296 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import fixtures from '../../__fixtures__/fixtures'
import Model from '../Model'
import ModelDefinition from '../ModelDefinition'
describe('Model', () => {
Function request
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Open
request(method, url, data, options = {}) {
checkType(method, 'string', 'Request type')
checkType(url, 'string', 'Url')
const api = this
let requestUrl = url
- 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
File SystemConfiguration.spec.js
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import MockApi from '../../api/Api'
import SystemConfiguration from '../SystemConfiguration'
jest.mock('../../api/Api')
File Api.js
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* @module api
*/
import 'isomorphic-fetch'
import { checkType } from '../lib/check'