hokulea/aria-voyager

View on GitHub

Showing 16 of 50 total issues

Function exports has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = async function () {
  return {
    useYarn: true,
    scenarios: [
      {
Severity: Major
Found in packages/ember-aria-voyager/test-app/config/ember-try.js - About 2 hrs to fix

    Consider simplifying this complex logical expression.
    Open

        if (
          event.key === 'ArrowUp' ||
          event.key === 'ArrowDown' ||
          event.key === 'ArrowLeft' ||
          event.key === 'ArrowRight' ||
    Severity: Critical
    Found in packages/aria-voyager/src/navigation-patterns/scroll-to-item.ts - About 2 hrs to fix

      Function modify has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

        modify(
          element: Element,
          _: PositionalArgs<ListboxSignature<T>>,
          options: NamedArgs<ListboxSignature<T>>
        ) {
      Severity: Minor
      Found in packages/ember-aria-voyager/package/src/modifiers/listbox.ts - About 1 hr to fix

      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 testMenuKeyboardNavigation has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export async function testMenuKeyboardNavigation(
        assert: Assert,
        selectors: Partial<Selectors> = DEFAULT_SELECTORS
      ): Promise<void> {
        const { elements, selectors: allSelectors } = setupMenuTest(assert, selectors);
      Severity: Minor
      Found in packages/ember-aria-voyager/package/src/test-support/menu.ts - About 1 hr to fix

        Function modify has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          modify(
            element: Element,
            _: PositionalArgs<ListboxSignature<T>>,
            options: NamedArgs<ListboxSignature<T>>
          ) {
        Severity: Minor
        Found in packages/ember-aria-voyager/package/src/modifiers/listbox.ts - About 1 hr to fix

          Function testMenuPointerNavigation has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export async function testMenuPointerNavigation(
            assert: Assert,
            selectors: Partial<Selectors> = DEFAULT_SELECTORS
          ): Promise<void> {
            const { elements, selectors: allSelectors } = setupMenuTest(assert, selectors);
          Severity: Minor
          Found in packages/ember-aria-voyager/package/src/test-support/menu.ts - About 1 hr to fix

            Function testListboxForKeyboardMultiSelection has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export async function testListboxForKeyboardMultiSelection(
              assert: Assert,
              elements: {
                target: HTMLElement;
                list: HTMLElement;

              Function navigateWithPointer has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                navigateWithPointer(event: PointerEvent) {
                  // hover ...
                  if (event.type === 'pointerover') {
                    // close sibling menus
                    this.control.items
              Severity: Minor
              Found in packages/aria-voyager/src/navigation-patterns/menu-navigation.ts - About 1 hr to fix

                Function testListboxForPointerMultiSelection has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export async function testListboxForPointerMultiSelection(
                  assert: Assert,
                  elements: {
                    target: HTMLElement;
                    list: HTMLElement;

                  Function select has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export async function select(
                    target: Target,
                    options: string | string[],
                    {
                      keepPreviouslySelected = false,

                  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 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  module.exports = function (environment) {
                    let ENV = {
                      modulePrefix: 'ember-aria-voyager-test-app',
                      environment,
                      rootURL: '/',
                  Severity: Minor
                  Found in packages/ember-aria-voyager/test-app/config/environment.js - About 1 hr to fix

                    Function createIndexEmitter has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function createIndexEmitter<T>(listbox: Listbox, options: NamedArgs<ListboxSignature<T>>) {
                      const findByIndex = (index: number) => {
                        return (options as WithItems<T>).items[index] ?? undefined;
                      };
                    
                    
                    Severity: Minor
                    Found in packages/ember-aria-voyager/package/src/modifiers/listbox.ts - About 55 mins to fix

                    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 navigateWithPointer has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      navigateWithPointer(event: PointerEvent) {
                        // hover ...
                        if (event.type === 'pointerover') {
                          // close sibling menus
                          this.control.items
                    Severity: Minor
                    Found in packages/aria-voyager/src/navigation-patterns/menu-navigation.ts - About 45 mins to fix

                    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 modify has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      modify(
                        element: Element,
                        _: PositionalArgs<MenuSignature<T>>,
                        options: NamedArgs<MenuSignature<T>>
                      ) {
                    Severity: Minor
                    Found in packages/ember-aria-voyager/package/src/modifiers/menu.ts - About 45 mins to fix

                    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 handle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      handle(bag: NavigationParameterBag): NavigationParameterBag {
                        const { event } = bag;
                    
                        // navigation handlers
                        if (event.type === 'keydown') {
                    Severity: Minor
                    Found in packages/aria-voyager/src/navigation-patterns/menu-navigation.ts - About 25 mins to fix

                    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 closeRootMenu has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      closeRootMenu() {
                        const getRootMenu = (menu: MenuElement): HTMLElement | undefined => {
                          const menus = [];
                    
                          let elem: HTMLElement | null = menu;
                    Severity: Minor
                    Found in packages/aria-voyager/src/navigation-patterns/menu-navigation.ts - About 25 mins to fix

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language