Showing 120 of 122 total issues
Function createTotals
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private createTotals(): DaffOrderTotal[] {
return [
this.totalFactory.create({
label: 'Grand Total',
type: DaffOrderTotalTypeEnum.GrandTotal,
Function list
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
list(cartId?: DaffCart['id']): Observable<DaffOrderCollection> {
return this.apollo.query<MagentoGetGuestOrdersResponse>({
query: getGuestOrders(this.extraOrderFragments),
variables: {
cartId,
Function addItem
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private addItem(reqInfo: RequestInfo): DaffCart {
const cart = this.getCart(reqInfo);
const cartIndex = reqInfo.collection.findIndex(c => c.id === reqInfo.id);
const itemInput = reqInfo.utils.getJsonBody(reqInfo.req);
const existingCartItemIndex = cart.items.findIndex(item => item.product_id === itemInput.productId);
Function daffSearchCreateSearchSelectors
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const daffSearchCreateSearchSelectors = <T extends DaffSearchResult = DaffSearchResult, R extends DaffSearchStateRootSlice<T> = DaffSearchStateRootSlice<T>>(
stateSelector: MemoizedSelector<R, DaffSearchReducerState<T>>,
) => {
const selectSearchLoading = createSelector(
stateSelector,
Function list
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
list(cartId?: DaffCart['id']): Observable<DaffOrderCollection> {
return this.apollo.query<MagentoGetGuestOrdersResponse>({
query: getGuestOrders(this.extraOrderFragments),
variables: {
cartId,
Function daffColorMixin
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function
daffColorMixin<T extends Constructor<HasElementRef>>(Base: T, defaultColor?: DaffPalette) {
class DaffColorableMixinClass extends Base {
//TODO move this back to private in Typescript 3.1
_color: DaffPalette;
Function forRoot
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
static forRoot(): ModuleWithProviders<DaffUpsellProductsMagentoDriverModule> {
return {
ngModule: DaffUpsellProductsMagentoDriverModule,
providers: [
{
Function cartResolveReducer
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function cartResolveReducer<T extends DaffCart = DaffCart>(
state = daffCartReducerInitialState,
action: ActionTypes<T>,
): DaffCartReducerState<T> {
switch (action.type) {
Function daffCustomerReducer
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const daffCustomerReducer = <T extends DaffCustomer = DaffCustomer>(
state = daffCustomerInitialState,
action: DaffCustomerActions<T> | DaffCustomerAddressActions,
): DaffCustomerReducerState<T> => {
switch (action.type) {
Function forRoot
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
static forRoot(): ModuleWithProviders<DaffCompositeProductMagentoDriverModule> {
return {
ngModule: DaffCompositeProductMagentoDriverModule,
providers: [
...daffProvideProductMagentoExtraProductFragments(magentoBundledProductFragment),
Function daffSearchProductCollectionReducer
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const daffSearchProductCollectionReducer = (
state: DaffCollectionMetadata = daffCollectionReducerInitialState,
action: DaffSearchActions | DaffSearchProductCollectionActions,
): DaffCollectionMetadata => {
switch (action.type) {
Function onAnimationComplete
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
@HostListener('@transformSidebar.done', ['$event']) onAnimationComplete(e: AnimationEvent) {
if(isOpening(<DaffSidebarAnimationState>e.fromState, <DaffSidebarAnimationState>e.toState)) {
this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);
const focusableChild = (<HTMLElement>this._elementRef.nativeElement.querySelector(daffFocusableElementsSelector));
- 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 getAnimationState
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const getAnimationState = (open: boolean, mode: DaffSidebarMode): DaffSidebarAnimationState => {
if(mode === 'side') {
return 'none';
}
- 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 daffSizeMixin
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function
daffSizeMixin<V extends DaffSizeAllType, T extends Constructor<HasElementRef> = Constructor<HasElementRef>>(Base: T, defaultSize?: V) {
class DaffSizeMixinClass extends Base {
//TODO move this back to private in Typescript 3.1
_size: V;
- 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 create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
create(address): AddressFormGroup {
return this.fb.group({
firstname: [address ? address.firstname : '', Validators.required],
lastname: [address ? address.lastname : '', Validators.required],
street: [address ? address.street : '', Validators.required],
- 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 daffTextAlignmentMixin
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function
daffTextAlignmentMixin<T extends Constructor<HasElementRef>>(Base: T, defaultTextAlignment?: DaffTextAlignment) {
class DaffTextAlignableMixin extends Base {
// TODO move this back to private in Typescript 3.1
_textAlignment: DaffTextAlignment;
- 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 add
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
add(gallery: DaffMediaGalleryRegistration, thumbnail?: DaffThumbnailRegistration) {
if(this.galleries[gallery.name]) {
let newGallery = this.galleries[gallery.name].getValue();
if(thumbnail) {
- 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 _createOverlay
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected async _createOverlay(activatorElement: ViewContainerRef, component: DaffMenuSlot) {
if (!this._overlay) {
this._overlay = daffMenuCreateOverlay(this.overlay, activatorElement.element);
if(typeof component === 'object' && (<DaffLazyComponent>component)?.import) {
component = await (<DaffLazyComponent>component).import();
- 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 getRequest
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getRequest(queryParamMap: ParamMap): DaffCollectionRequest {
const request = DAFF_PRODUCT_COLLECTION_REQUEST_FIELDS.reduce<DaffCollectionRequest>((acc, field) => {
const qp = this.config.params[field] || field;
if (queryParamMap.has(qp)) {
const qpVal = queryParamMap.get(qp);
- 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 daffStatusMixin
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function
daffStatusMixin<T extends Constructor<HasElementRef>>(Base: T, defaultStatus?: DaffStatus) {
class DaffStatusMixinClass extends Base {
// TODO move this back to private in Typescript 3.1
_status: DaffStatus;
- 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"