bufferapp/ui

View on GitHub

Showing 333 of 333 total issues

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

  render() {
    // @ts-expect-error TS(2339) FIXME: Property 'navigationLinks' does not exist on type ... Remove this comment to see the full error message
    const { navigationLinks } = this.state
    // @ts-expect-error TS(2339) FIXME: Property 'route' does not exist on type 'Readonly<... Remove this comment to see the full error message
    const { route } = this.props
Severity: Major
Found in src/documentation/app/layout/sidebar/Sidebar.tsx - About 2 hrs to fix

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

    const ImportIcon = createIconComponent({
      content: (
        <g>
          <path
            fillRule="evenodd"
    Severity: Major
    Found in src/components/Icon/Icons/Import.tsx and 3 other locations - About 2 hrs to fix
    src/components/Icon/Icons/AddMedia.tsx on lines 8..23
    src/components/Icon/Icons/Analyze.tsx on lines 8..23
    src/components/Icon/Icons/Promoted.tsx on lines 8..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 76.

    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

    const PromotedIcon = createIconComponent({
      content: (
        <g>
          <path
            fillRule="evenodd"
    Severity: Major
    Found in src/components/Icon/Icons/Promoted.tsx and 3 other locations - About 2 hrs to fix
    src/components/Icon/Icons/AddMedia.tsx on lines 8..23
    src/components/Icon/Icons/Analyze.tsx on lines 8..23
    src/components/Icon/Icons/Import.tsx on lines 8..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 76.

    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

    const AnalyzeIcon = createIconComponent({
      content: (
        <g>
          <path
            fillRule="evenodd"
    Severity: Major
    Found in src/components/Icon/Icons/Analyze.tsx and 3 other locations - About 2 hrs to fix
    src/components/Icon/Icons/AddMedia.tsx on lines 8..23
    src/components/Icon/Icons/Import.tsx on lines 8..23
    src/components/Icon/Icons/Promoted.tsx on lines 8..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 76.

    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

    const AddMediaIcon = createIconComponent({
      content: (
        <g>
          <path
            fillRule="evenodd"
    Severity: Major
    Found in src/components/Icon/Icons/AddMedia.tsx and 3 other locations - About 2 hrs to fix
    src/components/Icon/Icons/Analyze.tsx on lines 8..23
    src/components/Icon/Icons/Import.tsx on lines 8..23
    src/components/Icon/Icons/Promoted.tsx on lines 8..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 76.

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

    export default function ExampleSelectMenu() {
      return (
        <Select
          // @ts-expect-error TS(7006) FIXME: Parameter 'selectedItem' implicitly has an 'any' t... Remove this comment to see the full error message
          onSelectClick={(selectedItem) => selectedItem.selectedItemClick()}
    Severity: Major
    Found in src/documentation/examples/Select/SelectWithMenuAndCustomItem.tsx - About 2 hrs to fix

      Function ExampleSelect has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function ExampleSelect() {
        return (
          // @ts-expect-error TS(2607) FIXME: JSX element class does not support attributes beca... Remove this comment to see the full error message
          <Select
            onSelectClick={() => console.info('Main select clicked')}

        Function ExampleSelect has 51 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Function Option has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const Option = (props) => {
            const {
              selected,
              disabled,
              icon,
          Severity: Minor
          Found in src/components/SegmentedControl/Option/Option.tsx - About 1 hr to fix

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

              render() {
                const {
                  // @ts-expect-error TS(2339) FIXME: Property 'match' does not exist on type 'Readonly<... Remove this comment to see the full error message
                  match: {
                    params: { route, location, view },
            Severity: Minor
            Found in src/documentation/app/AppContainer.tsx - About 1 hr to fix

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

              export default function ModalTest() {
                const previousFocusRef = React.createRef()
                const [modalOpen, openModal] = useState(false)
                return (
                  <div
              Severity: Minor
              Found in src/documentation/examples/Modal/focus_reset.tsx - About 1 hr to fix

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

                    <Carousel width="400px">
                      <img
                        src="https://buffer-analyze.s3.amazonaws.com/images/modal-pro-bg.png"
                        alt="slide 1"
                        width="400"
                Severity: Major
                Found in src/documentation/examples/Carousel/Carousel.tsx and 2 other locations - About 1 hr to fix
                src/documentation/examples/Carousel/Carousel-no-indicators.tsx on lines 8..24
                src/documentation/examples/Carousel/Carousel-one-direction.tsx on lines 8..24

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

                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

                  helpMenuItems: PropTypes.arrayOf(
                    PropTypes.shape({
                      id: PropTypes.string.isRequired,
                      title: PropTypes.string.isRequired,
                      component: PropTypes.node,
                Severity: Major
                Found in src/components/NavBar/NavBar.tsx and 1 other location - About 1 hr to fix
                src/components/NavBar/NavBar.tsx on lines 365..373

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

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

                    <Carousel width="400px" withIndicators={false}>
                      <img
                        src="https://buffer-analyze.s3.amazonaws.com/images/modal-pro-bg.png"
                        alt="slide 1"
                        width="400"
                src/documentation/examples/Carousel/Carousel-one-direction.tsx on lines 8..24
                src/documentation/examples/Carousel/Carousel.tsx on lines 8..24

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

                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

                    menuItems: PropTypes.arrayOf(
                      PropTypes.shape({
                        id: PropTypes.string.isRequired,
                        title: PropTypes.string.isRequired,
                        component: PropTypes.func,
                Severity: Major
                Found in src/components/NavBar/NavBar.tsx and 1 other location - About 1 hr to fix
                src/components/NavBar/NavBar.tsx on lines 375..383

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

                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

                      if (items[i]) {
                        this.setState({ hoveredItem: i % itemsLength })
                        this.scrollToItem(
                          // @ts-expect-error TS(2339) FIXME: Property 'itemsNode' does not exist on type 'Selec... Remove this comment to see the full error message
                          this.itemsNode,
                Severity: Major
                Found in src/components/Select/Select.tsx and 1 other location - About 1 hr to fix
                src/components/Select/Select.tsx on lines 367..375

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

                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

                      if (items[i]) {
                        this.setState({ hoveredItem: i % itemsLength })
                        this.scrollToItem(
                          // @ts-expect-error TS(2339) FIXME: Property 'itemsNode' does not exist on type 'Selec... Remove this comment to see the full error message
                          this.itemsNode,
                Severity: Major
                Found in src/components/Select/Select.tsx and 1 other location - About 1 hr to fix
                src/components/Select/Select.tsx on lines 292..300

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

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

                  render() {
                    const {
                      // @ts-expect-error TS(2339) FIXME: Property 'menubarItem' does not exist on type 'Rea... Remove this comment to see the full error message
                      menubarItem,
                      // @ts-expect-error TS(2339) FIXME: Property 'items' does not exist on type 'Readonly<... Remove this comment to see the full error message
                Severity: Minor
                Found in src/components/DropdownMenu/DropdownMenu.tsx - About 1 hr to fix

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

                      <Carousel width="400px" rightNavigation>
                        <img
                          src="https://buffer-analyze.s3.amazonaws.com/images/modal-pro-bg.png"
                          alt="slide 1"
                          width="400"
                  src/documentation/examples/Carousel/Carousel-no-indicators.tsx on lines 8..24
                  src/documentation/examples/Carousel/Carousel.tsx on lines 8..24

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

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

                  export default function ExampleTooltip() {
                    return (
                      <Tooltip label="My Tooltip Label 🙌" position="top">
                        <Button type="primary" onClick={() => {}} label="Click Me" fullWidth />
                      </Tooltip>
                  Severity: Major
                  Found in src/documentation/examples/Tooltip/position/top.tsx and 2 other locations - About 1 hr to fix
                  src/documentation/examples/Tooltip/position/left.tsx on lines 8..14
                  src/documentation/examples/Tooltip/position/right.tsx on lines 8..14

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

                  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