Showing 15 of 46 total issues
File entity.ts
has 339 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { keys, reduce, isNil, cloneDeep, difference, forEach, castArray, isUndefined, isNull, defaults, chain, isEqual, mapValues, isObject, isString, isInteger, slice, concat, uniq, reject, transform, isEmpty, without, values } from 'lodash';
import { SequentialEvent } from 'sequential-event';
import { Adapter } from '../adapters';
import AAdapterEntity = Adapter.Base.AAdapterEntity;
- Create a ticketCreate a ticket
Entity
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export abstract class Entity<TEntity extends IEntityAttributes> extends SequentialEvent {
public get attributes() {
return this.getAttributes();
}
- Create a ticketCreate a ticket
File dataAccessLayer.ts
has 298 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { isString, isNumber, map, isNil, Dictionary, chain, castArray, forEach } from 'lodash';
import { Adapter as _Base } from './base';
import AAdapterEntity = _Base.Base.AAdapterEntity;
import AAdapter = _Base.Base.AAdapter;
- Create a ticketCreate a ticket
File adapter.ts
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { pick, assign, isNil, cloneDeep, forOwn, defaults, mapKeys, forEach, isNumber, isDate, chain, isUndefined, Dictionary, invert, first, compact, mapValues } from 'lodash';
import { SequentialEvent } from 'sequential-event';
import { Adapter as _AAdapterEntity } from './entity';
import AAdapterEntity = _AAdapterEntity.Base.AAdapterEntity;
- Create a ticketCreate a ticket
File adapter.ts
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { map, forIn, assign, omit, isArray, isUndefined, isNil, get } from 'lodash';
import { Adapter as _AAdapter } from '../base';
import AAdapter = _AAdapter.Base.AAdapter;
import { Adapter as _WebApiEntity } from './entity';
- Create a ticketCreate a ticket
DataAccessLayer
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export class DataAccessLayer<
TEntity extends AAdapterEntity = AAdapterEntity,
TAdapter extends AAdapter<TEntity> = AAdapter<TEntity>
> extends SequentialEvent implements IDataSourceQuerier<
TEntity,
- Create a ticketCreate a ticket
AAdapter
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export abstract class AAdapter<TAdapterEntity extends AAdapterEntity = AAdapterEntity>
extends SequentialEvent
implements IDataSourceQuerier<IEntityAttributes, IEntityProperties> {
public get classEntity() {
return this._classEntity;
- Create a ticketCreate a ticket
File checkTransformer.ts
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { get, isInteger, map, isEmpty, some, isNil, compact, flatten, values, every, chain, assign, defaults, forEach, Dictionary, isString, isNumber, isDate, isBoolean, isObject, isArray, castArray, mapValues, omitBy } from 'lodash';
import { EntityTransformers as EntityTransformers_EntityTransformer } from './entityTransformer';
import EntityTransformer = EntityTransformers_EntityTransformer.AEntityTransformer;
import { PathStack } from './pathStack';
- Create a ticketCreate a ticket
Model
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export class Model<TEntity extends IEntityAttributes> {
public attributes: { [key: string]: _ModelDescription.FieldDescriptor };
private readonly _dataSources: IDataSourceRegistry;
public modelDesc: _ModelDescription.IModelDescription;
- Create a ticketCreate a ticket
Function applyField
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public applyField(
value: any,
propPath: PathStack | string[],
options: { getProps: boolean } = { getProps: false }
): any {
- Create a ticketCreate a ticket
Function constructor
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public constructor() {
const voidFct = () => {
return;
};
super( {
- Create a ticketCreate a ticket
Function applyField
has a Cognitive Complexity of 17 (exceeds 10 allowed). Consider refactoring. Open
Open
public applyField(
value: any,
propPath: PathStack | string[],
options: { getProps: boolean } = { getProps: false }
): any {
- Read upRead up
- Create a ticketCreate a ticket
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 EFieldType.ARRAY
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[EFieldType.ARRAY](
this: CheckTransformer,
keys: PathStack,
fieldDesc: _ModelDescription.FieldDescriptor.IArrayFieldDescriptor,
values: any[]
- Create a ticketCreate a ticket
Function DefaultQueryTransformerFactory
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const DefaultQueryTransformerFactory: IEventProviderFactory = (
config: any
) => {
/**
* Get the plural name of an endpoint.
- Create a ticketCreate a ticket
Function persist
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async persist( sourceName?: string ): Promise<Set<TEntity>> {
const suffixes = map( this, entity => ( 'orphan' === entity.state ? 'Create' : 'Update' ) );
const _allEmit = partial( allEmit, this );
await _allEmit( 'Persist', 'before' );
await _allEmit( 'Validate', 'before' );
- Create a ticketCreate a ticket