Showing 122 of 124 total issues
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"
Further reading
Function sidebarViewportContentShift
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const sidebarViewportContentShift = (sidebars: QueryList<DaffSidebarComponent>): number =>
sidebars.reduce((acc: number, sidebar) => {
if(!isViewportContentShifted(sidebar.mode, sidebar.open)) {
return acc;
}
- 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 transformMagentoCartGraphQlError
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function transformMagentoCartGraphQlError(error: GraphQLError, requestPayload?: unknown): DaffError {
// TODO: readdress this when we move to eslint
// eslint-disable-next-line
for (const code in DaffCartMagentoErrorMessageRegexMap) {
const matchIndex = error.message.search(DaffCartMagentoErrorMessageRegexMap[code]);
- 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
Avoid too many return
statements within this function. Open
return 'closed';
Avoid too many return
statements within this function. Open
return this.sendResetEmail(reqInfo);
Avoid too many return
statements within this function. Open
return 'open';
Avoid too many return
statements within this function. Open
return 'under-closed';
Avoid too many return
statements within this function. Open
return this.categoryTestingService.get(reqInfo);
Avoid too many return
statements within this function. Open
return this.resetPassword(reqInfo);
Function traverseRouteTree
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const traverseRouteTree = (routes: Routes = [], matcher: (route: Route) => boolean, operate: RouteOperator): Routes => {
if(routes.length === 0) {
return routes;
}
- 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 isOpening
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const isOpening = (fromState: DaffSidebarAnimationState, toState: DaffSidebarAnimationState): boolean => {
if(fromState === 'under-open' && toState === 'open' || fromState === 'open' && toState === 'under-open') {
return false;
}
- 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 validateGetBlocksResponse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const validateGetBlocksResponse = (response: ApolloQueryResult<MagentoGetBlocksResponse>) => {
if (response.data?.cmsBlocks?.items) {
if (response.data.cmsBlocks.items.reduce((acc, block) => acc && !!(
block.identifier
&& block.content
- 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 getVariables
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private getVariables(options: DaffSearchProductDriverOptions = {}) {
const queryVariables = {
filter: this.productFilterRequestsTransformer.transform(options.filterRequests),
};
if (options.pageSize || options.limit) {
- 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 post
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
post(reqInfo) {
if (reqInfo.id === 'login') {
return this.login(reqInfo);
} else if (reqInfo.id === 'register') {
return this.register(reqInfo);
- 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 daffCompactableMixin
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function
daffCompactableMixin<T extends Constructor<HasElementRef>>(Base: T, defaultCompact: boolean = false) {
return class extends Base {
// TODO move this back to private in Typescript 3.1
_compact: boolean;
- 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 ngOnChanges
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
ngOnChanges(changes: SimpleChanges): void {
if(!changes.tree.currentValue) {
this._tree = undefined;
this.flatTree = [];
return;
- 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 validateGetOrdersResponse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const validateGetOrdersResponse = (response: ApolloQueryResult<MagentoGetGuestOrdersResponse>) => {
if (response.data?.graycoreGuestOrders?.items) {
if (response.data.graycoreGuestOrders.items.reduce((acc, order) => acc && !!(
order.billing_address
&& order.shipping_address
- 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 validateGetOrdersResponse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const validateGetOrdersResponse = (response: ApolloQueryResult<MagentoGetGuestOrdersResponse>) => {
if (response.data?.graycoreGuestOrders?.orders) {
if (response.data.graycoreGuestOrders.orders.reduce((acc, order) => acc && !!(
order.billing_address
&& order.shipping_address
- 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"