xcv58/Tab-Manager-v2

View on GitHub
packages/extension/src/js/components/AutocompleteSearch/index.tsx

Summary

Maintainability
A
2 hrs
Test Coverage

Showing 1 of 4 total issues

Function AutocompleteSearch has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const AutocompleteSearch = observer((props: Props) => {
const { autoFocus, open } = props
const searchInputRef = useSearchInputRef()
const options = useOptions()
const { userStore, searchStore } = useStore()
Severity: Major
Found in packages/extension/src/js/components/AutocompleteSearch/index.tsx - About 2 hrs to fix

    Function getFilterOptions has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Wontfix

    const getFilterOptions = (showUrl, isCommand) => {
    if (isCommand) {
    return commandFilter
    }
    return (options, { inputValue }) => {
    Severity: Minor
    Found in packages/extension/src/js/components/AutocompleteSearch/index.tsx - About 1 hr to fix

      Function sortRankedValues has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Wontfix

      function sortRankedValues(a, b, baseSort): number {
      const aFirst = -1
      const bFirst = 1
      const { rank: aRank, keyIndex: aKeyIndex } = a
      const { rank: bRank, keyIndex: bKeyIndex } = b
      Severity: Minor
      Found in packages/extension/src/js/components/AutocompleteSearch/index.tsx - About 1 hr to fix

      Function getFilterOptions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Wontfix

      const getFilterOptions = (showUrl, isCommand) => {
      if (isCommand) {
      return commandFilter
      }
      return (options, { inputValue }) => {
      Severity: Minor
      Found in packages/extension/src/js/components/AutocompleteSearch/index.tsx - About 25 mins to fix
      Category
      Status