xcv58/Tab-Manager-v2

View on GitHub

Showing 27 of 68 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export default observer(() => {
  const { searchStore } = useStore()
  const { invertSelect, matchedTabs } = searchStore
  return (
    <Tooltip title={TITLE} enterDelay={TOOLTIP_DELAY}>
packages/extension/src/js/components/Toolbar/RemoveDuplicated.tsx on lines 11..28

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 147.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export default observer(() => {
  const { windowStore } = useStore()
  const { cleanDuplicatedTabs, duplicatedTabs } = windowStore
  return (
    <Tooltip title={TITLE} enterDelay={TOOLTIP_DELAY}>
packages/extension/src/js/components/Toolbar/InvertSelect.tsx on lines 11..28

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 147.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export default observer(() => {
  const { userStore } = useStore()
  return (
    <Tooltip title={TITLE} enterDelay={TOOLTIP_DELAY}>
      <div className="flex">
Severity: Major
Found in packages/extension/src/js/components/Toolbar/Settings.tsx and 1 other location - About 4 hrs to fix
packages/extension/src/js/components/Toolbar/Help.tsx on lines 11..26

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 124.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export default observer(() => {
  const { shortcutStore } = useStore()
  return (
    <Tooltip title={TITLE} enterDelay={TOOLTIP_DELAY}>
      <div className="flex">
Severity: Major
Found in packages/extension/src/js/components/Toolbar/Help.tsx and 1 other location - About 4 hrs to fix
packages/extension/src/js/components/Toolbar/Settings.tsx on lines 11..26

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 124.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    File FocusStore.tsx has 254 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { makeAutoObservable } from 'mobx'
    import Store from 'stores'
    import log from 'libs/log'
    import Tab from './Tab'
    import Window from './Window'
    Severity: Minor
    Found in packages/extension/src/js/stores/FocusStore.tsx - About 2 hrs to fix

      Function Icon has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const Icon = observer((props: TabProps) => {
        const { userStore } = useStore()
        const { focus, select, iconUrl, isSelected, bulkSelect } = props.tab
        const checkbox = (
          <Checkbox
      Severity: Major
      Found in packages/extension/src/js/components/Tab/Icon.tsx - About 2 hrs to fix

        Function constructor has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          constructor(tab, store: Store, win: Window) {
            super(store)
        
            makeObservable(this, {
              cookieStoreId: observable,
        Severity: Minor
        Found in packages/extension/src/js/stores/Tab.tsx - About 1 hr to fix

          Function TabContent has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            (props: TabProps & { buttonClassName: string; content: ReactElement }) => {
              const { faked, buttonClassName, content } = props
              const { hoverStore, dragStore } = useStore()
              const { activate, title, url, isDuplicated, focus, isFocused, isHovered } =
                props.tab
          Severity: Minor
          Found in packages/extension/src/js/components/Tab/TabContent.tsx - About 1 hr to fix

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                process.env.TARGET_BROWSER === 'firefox' && [
                  ['alt+x'],
                  (event: Event) => {
                    preventDefault(event)
                    this.store.focusStore.selectTabsInSameContainer()
            Severity: Major
            Found in packages/extension/src/js/stores/ShortcutStore.tsx and 1 other location - About 1 hr to fix
            packages/extension/src/js/stores/ShortcutStore.tsx on lines 420..427

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 60.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                process.env.TARGET_BROWSER === 'firefox' && [
                  ['alt+c'],
                  (event: Event) => {
                    preventDefault(event)
                    this.store.containerStore.groupTabsByContainer()
            Severity: Major
            Found in packages/extension/src/js/stores/ShortcutStore.tsx and 1 other location - About 1 hr to fix
            packages/extension/src/js/stores/ShortcutStore.tsx on lines 412..419

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 60.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

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

                      transform: function (content) {
                        const json = JSON.parse(content.toString())
                        if (process.env.NODE_ENV === 'production') {
                          delete json.content_security_policy
                        }
            Severity: Minor
            Found in packages/extension/webpack.config.js - About 1 hr to fix

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                constructor(store: Store) {
                  makeObservable(this, {
                    hoveredTabId: observable,
                    hovered: observable,
                    hover: action,
              Severity: Major
              Found in packages/extension/src/js/stores/HoverStore.tsx and 1 other location - About 1 hr to fix
              packages/extension/src/js/stores/Focusable.tsx on lines 8..17

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 55.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                constructor(store: Store) {
                  makeObservable(this, {
                    id: observable,
                    nodeRef: observable,
                    setNodeRef: action,
              Severity: Major
              Found in packages/extension/src/js/stores/Focusable.tsx and 1 other location - About 1 hr to fix
              packages/extension/src/js/stores/HoverStore.tsx on lines 11..20

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 55.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                selectTabsInSameContainer =
                  process.env.TARGET_BROWSER === 'firefox'
                    ? () => {
                        this.store.tabStore.selectTabsInSameContainer(this)
                      }
              Severity: Minor
              Found in packages/extension/src/js/stores/Tab.tsx and 1 other location - About 50 mins to fix
              packages/extension/src/js/stores/Tab.tsx on lines 235..240

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 52.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                openSameContainerTabs =
                  process.env.TARGET_BROWSER === 'firefox'
                    ? () => {
                        this.store.containerStore.openSameContainerTabs(this)
                      }
              Severity: Minor
              Found in packages/extension/src/js/stores/Tab.tsx and 1 other location - About 50 mins to fix
              packages/extension/src/js/stores/Tab.tsx on lines 228..233

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 52.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 4 locations. Consider refactoring.
              Open

                    gray: {
                      100: '#f7fafc',
                      200: '#edf2f7',
                      300: '#e2e8f0',
                      400: '#cbd5e0',
              Severity: Major
              Found in packages/extension/tailwind.config.js and 3 other locations - About 50 mins to fix
              packages/extension/tailwind.config.js on lines 24..34
              packages/extension/tailwind.config.js on lines 35..45
              packages/extension/tailwind.config.js on lines 46..56

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 51.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 4 locations. Consider refactoring.
              Open

                    green: {
                      100: '#f0fff4',
                      200: '#c6f6d5',
                      300: '#9ae6b4',
                      400: '#68d391',
              Severity: Major
              Found in packages/extension/tailwind.config.js and 3 other locations - About 50 mins to fix
              packages/extension/tailwind.config.js on lines 13..23
              packages/extension/tailwind.config.js on lines 24..34
              packages/extension/tailwind.config.js on lines 46..56

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 51.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 4 locations. Consider refactoring.
              Open

                    blue: {
                      100: '#ebf8ff',
                      200: '#bee3f8',
                      300: '#90cdf4',
                      400: '#63b3ed',
              Severity: Major
              Found in packages/extension/tailwind.config.js and 3 other locations - About 50 mins to fix
              packages/extension/tailwind.config.js on lines 13..23
              packages/extension/tailwind.config.js on lines 24..34
              packages/extension/tailwind.config.js on lines 35..45

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 51.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 4 locations. Consider refactoring.
              Open

                    red: {
                      100: '#fff5f5',
                      200: '#fed7d7',
                      300: '#feb2b2',
                      400: '#fc8181',
              Severity: Major
              Found in packages/extension/tailwind.config.js and 3 other locations - About 50 mins to fix
              packages/extension/tailwind.config.js on lines 13..23
              packages/extension/tailwind.config.js on lines 35..45
              packages/extension/tailwind.config.js on lines 46..56

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 51.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Severity
              Category
              Status
              Source
              Language