Showing 36 of 86 total issues
File group-utils.ts
has 1084 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { A } from '@ember/array';
import { isEqual } from '@ember/utils';
export type MatcherFn = (option: any, text: string) => number;
export function isGroup(entry: any): boolean {
Function findOptionWithOffset
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
export function findOptionWithOffset(
options: any,
text: string,
matcher: MatcherFn,
offset: number,
- 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 addHandlers
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
@action
addHandlers(element: Element) {
const isGroup = element.getAttribute('data-optgroup') === 'true';
if (isGroup) {
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 exports
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = async function () {
return {
usePnpm: true,
scenarios: [
{
Function exports
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = async function () {
return {
usePnpm: true,
scenarios: [
{
Function optionAtIndex
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export function optionAtIndex(
originalCollection: any,
index: number,
): { disabled: boolean; option: any } {
let counter = 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 addHandlers
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
@action
addHandlers(element: Element) {
const isGroup = element.getAttribute('data-optgroup') === 'true';
if (isGroup) {
return;
Function afterInstall
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
afterInstall() {
let dependencies = this.project.dependencies();
const promises = [];
Function selectChoose
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function selectChoose(
cssPathOrTrigger: string | HTMLElement,
valueOrSelector: string,
optionIndex?: number,
) {
Function selectChoose
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export async function selectChoose(
cssPathOrTrigger: string | HTMLElement,
valueOrSelector: string,
optionIndex?: number,
) {
- 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 indexOfOption
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export function indexOfOption(collection: any, option: any): number {
let index = 0;
return (function walk(collection): number {
if (!collection) {
return -1;
- 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 afterInstall
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
afterInstall() {
let dependencies = this.project.dependencies();
const promises = [];
- 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 handleKeydown
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
@action
handleKeydown(event: Event): false | void {
const e = event as KeyboardEvent;
if (e.target === null) return;
if (this.args.onKeydown && this.args.onKeydown(e) === 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 pathForOption
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export function pathForOption(collection: any, option: any): string {
return (function walk(collection): string {
if (!collection) {
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 selectSearch
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function selectSearch(
cssPathOrTrigger: string | HTMLElement,
value: string,
) {
let trigger: HTMLElement | null;
Function filterOptions
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export function filterOptions(
options: any,
text: string,
matcher: MatcherFn,
skipDisabled = 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 selectSearch
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export async function selectSearch(
cssPathOrTrigger: string | HTMLElement,
value: string,
) {
let trigger: HTMLElement | null;
- 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 optionAtIndex
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function optionAtIndex(
originalCollection: any,
index: number,
): { disabled: boolean; option: any } {
let counter = 0;
Function findOptionWithOffset
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function findOptionWithOffset(
options: any,
text: string,
matcher: MatcherFn,
offset: number,
Function handleKeydown
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
@action
handleKeydown(event: Event): false | void {
const e = event as KeyboardEvent;
if (e.target === null) return;
if (this.args.onKeydown && this.args.onKeydown(e) === false) {