bufferapp/ui

View on GitHub

Showing 333 of 333 total issues

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

    const wrapper = shallow(
      <Select
        // @ts-expect-error TS(2769) FIXME: No overload matches this call.
        onSelectClick={() => true}
        items={[
Severity: Major
Found in src/components/Select/Select.test.tsx and 1 other location - About 2 hrs to fix
src/components/Select/Select.test.tsx on lines 275..296

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 85.

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

    const wrapper = shallow(
      <Select
        // @ts-expect-error TS(2769) FIXME: No overload matches this call.
        onSelectClick={() => true}
        items={[
Severity: Major
Found in src/components/Select/Select.test.tsx and 1 other location - About 2 hrs to fix
src/components/Select/Select.test.tsx on lines 308..329

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 85.

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

  render() {
    const {
      children,
      // @ts-expect-error TS(2339) FIXME: Property 'background' does not exist on type 'Read... Remove this comment to see the full error message
      background,
Severity: Major
Found in src/components/Modal/Modal.tsx - About 2 hrs to fix

    File webpack.config.dev.js has 265 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    'use strict'
    
    const fs = require('fs')
    const path = require('path')
    const resolve = require('resolve')
    Severity: Minor
    Found in scripts/config/webpack.config.dev.js - About 2 hrs to fix

      Function render has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render() {
          const {
            // @ts-expect-error TS(2339) FIXME: Property 'disabled' does not exist on type 'Readon... Remove this comment to see the full error message
            disabled,
            // @ts-expect-error TS(2339) FIXME: Property 'hasError' does not exist on type 'Readon... Remove this comment to see the full error message
      Severity: Major
      Found in src/components/Input/Input.tsx - About 2 hrs to fix

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

        const options = [
          {
            label: 'Facebook',
            icon: <Facebook />,
            value: 'facebook',
        src/documentation/examples/SegmentedControl/Interactive/IconPosition.tsx on lines 9..25
        src/documentation/examples/SegmentedControl/Size/SizeLarge.tsx on lines 7..23
        src/documentation/examples/SegmentedControl/Size/SizeNormal.tsx on lines 7..23
        src/documentation/examples/SegmentedControl/Size/SizeSmall.tsx on lines 7..23
        src/documentation/examples/SegmentedControl/Type/TypeTextOnly.tsx on lines 7..23

        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 79.

        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 6 locations. Consider refactoring.
        Open

        const options = [
          {
            label: 'Facebook',
            icon: <Facebook />,
            value: 'facebook',
        src/documentation/examples/SegmentedControl/Interactive/IconPosition.tsx on lines 9..25
        src/documentation/examples/SegmentedControl/Size/SizeLarge.tsx on lines 7..23
        src/documentation/examples/SegmentedControl/Size/SizeSmall.tsx on lines 7..23
        src/documentation/examples/SegmentedControl/Type/TypeTextAndIcon.tsx on lines 7..23
        src/documentation/examples/SegmentedControl/Type/TypeTextOnly.tsx on lines 7..23

        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 79.

        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 6 locations. Consider refactoring.
        Open

        const options = [
          {
            label: 'Facebook',
            icon: <Facebook />,
            value: 'facebook',
        src/documentation/examples/SegmentedControl/Interactive/IconPosition.tsx on lines 9..25
        src/documentation/examples/SegmentedControl/Size/SizeLarge.tsx on lines 7..23
        src/documentation/examples/SegmentedControl/Size/SizeNormal.tsx on lines 7..23
        src/documentation/examples/SegmentedControl/Type/TypeTextAndIcon.tsx on lines 7..23
        src/documentation/examples/SegmentedControl/Type/TypeTextOnly.tsx on lines 7..23

        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 79.

        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 6 locations. Consider refactoring.
        Open

        const options = [
          {
            label: 'Facebook',
            icon: <Facebook />,
            value: 'facebook',
        src/documentation/examples/SegmentedControl/Size/SizeLarge.tsx on lines 7..23
        src/documentation/examples/SegmentedControl/Size/SizeNormal.tsx on lines 7..23
        src/documentation/examples/SegmentedControl/Size/SizeSmall.tsx on lines 7..23
        src/documentation/examples/SegmentedControl/Type/TypeTextAndIcon.tsx on lines 7..23
        src/documentation/examples/SegmentedControl/Type/TypeTextOnly.tsx on lines 7..23

        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 79.

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

        export default function ExampleSimpleModal() {
          const [changed, setChanged] = useState(false)
        
          useEffect(() => {
            setTimeout(() => {
        Severity: Major
        Found in src/documentation/examples/AnimationWrapper/AnimationWrapperHook.tsx - About 2 hrs to fix

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

          const options = [
            {
              label: 'Facebook',
              icon: <Facebook />,
              value: 'facebook',
          src/documentation/examples/SegmentedControl/Interactive/IconPosition.tsx on lines 9..25
          src/documentation/examples/SegmentedControl/Size/SizeLarge.tsx on lines 7..23
          src/documentation/examples/SegmentedControl/Size/SizeNormal.tsx on lines 7..23
          src/documentation/examples/SegmentedControl/Size/SizeSmall.tsx on lines 7..23
          src/documentation/examples/SegmentedControl/Type/TypeTextAndIcon.tsx on lines 7..23

          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 79.

          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 6 locations. Consider refactoring.
          Open

          const options = [
            {
              label: 'Facebook',
              icon: <Facebook />,
              value: 'facebook',
          src/documentation/examples/SegmentedControl/Interactive/IconPosition.tsx on lines 9..25
          src/documentation/examples/SegmentedControl/Size/SizeNormal.tsx on lines 7..23
          src/documentation/examples/SegmentedControl/Size/SizeSmall.tsx on lines 7..23
          src/documentation/examples/SegmentedControl/Type/TypeTextAndIcon.tsx on lines 7..23
          src/documentation/examples/SegmentedControl/Type/TypeTextOnly.tsx on lines 7..23

          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 79.

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

          export default function ExampleSimpleModal() {
            const [changed, setChanged] = useState(false)
          
            useEffect(() => {
              setTimeout(() => {
          Severity: Major
          Found in src/documentation/examples/AnimationWrapper/AnimationWrapper.tsx - About 2 hrs to fix

            Function createPackageFile has 54 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function createPackageFile() {
              return new Promise((resolve) => {
                // read from package.json
                fse.readFile(
                  path.resolve(__dirname, '../package.json'),
            Severity: Major
            Found in scripts/copyBuildFiles.js - About 2 hrs to fix

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

                items: PropTypes.arrayOf(
                  PropTypes.shape({
                    id: PropTypes.string,
                    title: PropTypes.string,
                    colors: PropTypes.shape({
              Severity: Major
              Found in src/components/DropdownMenu/PopupMenu/PopupMenu.tsx and 1 other location - About 2 hrs to fix
              src/components/DropdownMenu/DropdownMenu.tsx on lines 186..195

              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 78.

              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

                items: PropTypes.arrayOf(
                  PropTypes.shape({
                    id: PropTypes.string,
                    title: PropTypes.string,
                    colors: PropTypes.shape({
              Severity: Major
              Found in src/components/DropdownMenu/DropdownMenu.tsx and 1 other location - About 2 hrs to fix
              src/components/DropdownMenu/PopupMenu/PopupMenu.tsx on lines 284..293

              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 78.

              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

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

                    {
                      test: /\.(js|mjs|jsx)$/,
                      enforce: 'pre',
                      use: [
                        {
              Severity: Major
              Found in scripts/config/webpack.config.dev.js and 1 other location - About 2 hrs to fix
              scripts/config/webpack.config.prod.js on lines 254..267

              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 77.

              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

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

                    {
                      test: /\.(js|mjs|jsx)$/,
                      enforce: 'pre',
                      use: [
                        {
              Severity: Major
              Found in scripts/config/webpack.config.prod.js and 1 other location - About 2 hrs to fix
              scripts/config/webpack.config.dev.js on lines 180..193

              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 77.

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

              function build(previousFileSizes) {
                console.info('Creating an optimized production build...')
              
                const compiler = webpack(config)
                return new Promise((resolve, reject) => {
              Severity: Major
              Found in scripts/build.js - About 2 hrs to fix

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

                export default function ExampleOnOpn() {
                  return (
                    <Select
                      onSelectClick={() => console.info('Main select clicked')}
                      label="Click Me"
                Severity: Major
                Found in src/documentation/examples/Select/SelectWithOnOpen.tsx - About 2 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language