bufferapp/ui

View on GitHub

Showing 63 of 333 total issues

Function ExampleCrossSell has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function ExampleCrossSell() {
  const replyMock = {
    title: 'Provide amazing customer service on social media',
    subtitle:
      'Respond to social conversations, resolve customer support requests, and create an outstanding experience.',
Severity: Minor
Found in src/documentation/examples/CrossSell/CrossSell.tsx - About 1 hr to fix

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

    export default function ExampleSelectWithCustomItem() {
      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: Minor
    Found in src/documentation/examples/Select/SelectWithCustomItem.tsx - About 1 hr to fix

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

        getTooltipPosition(triggerRect, tooltipRect, position, verticalAlign) {
          // @ts-expect-error TS(2339) FIXME: Property 'childWidth' does not exist on type 'Read... Remove this comment to see the full error message
          const { childWidth } = this.state
          const gap = 8
          const triggerCenter = triggerRect.left + childWidth / 2
      Severity: Minor
      Found in src/components/Tooltip/Tooltip.tsx - About 1 hr to fix

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

        function optimizeSvgs(icons) {
          // https://github.com/svg/svgo/blob/master/examples/test.js
          const svgo = new SVGO({
            // Remove fills so all shapes inherit the CSS color
            plugins: [{ removeAttrs: { attrs: '(stroke|fill)' } }],
        Severity: Minor
        Found in scripts/generateIconComponents.js - About 1 hr to fix

          Function renderContent has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const renderContent = (channel) => {
            const content = {}
            switch (channel) {
              case 'instagram':
                // @ts-expect-error TS(2339) FIXME: Property 'Icon' does not exist on type '{}'.
          Severity: Minor
          Found in src/components/SocialButton/SocialButton.tsx - About 1 hr to fix

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

            function getExampleData(examplesPath, componentName) {
              // Get all the folders in src/docs/examples
              const folders = getExampleFolders(examplesPath, componentName)
              const fileExamples = getDocumentFiles(examplesPath, componentName)
            
            
            Severity: Minor
            Found in scripts/generateComponentData.js - About 1 hr to fix

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

              module.exports = function (proxy, allowedHost) {
                return {
                  // WebpackDevServer 2.4.3 introduced a security fix that prevents remote
                  // websites from potentially accessing local content through DNS rebinding:
                  // https://github.com/webpack/webpack-dev-server/issues/887
              Severity: Minor
              Found in scripts/config/webpackDevServer.config.js - About 1 hr to fix

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

                export default function ExampleSimpleModal() {
                  const [modalOpen, openModal] = useState(false)
                
                  useEffect(() => {
                    const selfDestroy = setTimeout(() => {

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

                    render() {
                      const {
                        // @ts-expect-error TS(2339) FIXME: Property 'item' does not exist on type 'Readonly<{... Remove this comment to see the full error message
                        item: { type, title, onItemClick, icon, selected, disabled, colors, tag },
                        // @ts-expect-error TS(2339) FIXME: Property 'ariaHaspopup' does not exist on type 'Re... Remove this comment to see the full error message
                  Severity: Minor
                  Found in src/components/DropdownMenu/ButtonItem/ButtonItem.tsx - About 1 hr to fix

                    Function Option has a Cognitive Complexity of 10 (exceeds 5 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

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

                      updateIfNeeded(prevProps) {
                        // @ts-expect-error TS(2339) FIXME: Property 'isOpen' does not exist on type 'Readonly... Remove this comment to see the full error message
                        const { isOpen, usingMouse, onOpen } = this.props
                        let newTabIndex = '-1'
                    
                    
                    Severity: Minor
                    Found in src/components/DropdownMenu/PopupMenu/PopupMenu.tsx - 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 main has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                    async function main() {
                      let spinner
                      try {
                        spinner = ora(`Loading BDS Icons Figma file: ${figmaIconFileUrl}`).start()
                        const figmaFile = await getFigmaFile(figmaIconFileId)
                    Severity: Minor
                    Found in scripts/generateIconComponents.js - 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 getDocumentsData has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function getDocumentsData(documentsPath) {
                      const folders = getDocumentationFolders(documentsPath)
                    
                      return folders.map((folder) => {
                        const documents = getDocumentFiles(documentsPath, folder)
                    Severity: Minor
                    Found in scripts/generateComponentData.js - About 1 hr to fix

                      Function ExampleSelectWithInputSearch has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default function ExampleSelectWithInputSearch() {
                        return (
                          <Select
                            onSelectClick={() => true}
                            // @ts-expect-error TS(7006) FIXME: Parameter 'onButtonClick' implicitly has an 'any' ... Remove this comment to see the full error message
                      Severity: Minor
                      Found in src/documentation/examples/Select/SelectWithInputSearch.tsx - About 1 hr to fix

                        Function getStyleLoaders has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const getStyleLoaders = (cssOptions, preProcessor) => {
                          const loaders = [
                            require.resolve('style-loader'),
                            {
                              loader: require.resolve('css-loader'),
                        Severity: Minor
                        Found in scripts/config/webpack.config.dev.js - About 1 hr to fix

                          Function render has a Cognitive Complexity of 9 (exceeds 5 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 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 onKeyDown has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                            onKeyDown(event) {
                              // eslint-disable-line
                              const {
                                // @ts-expect-error TS(2339) FIXME: Property 'history' does not exist on type 'Readonl... Remove this comment to see the full error message
                                history,
                          Severity: Minor
                          Found in src/documentation/app/AppContainer.tsx - 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 Button has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          const Button = ({
                            // @ts-expect-error TS(7031) FIXME: Binding element 'disabled' implicitly has an 'any'... Remove this comment to see the full error message
                            disabled,
                            // @ts-expect-error TS(7031) FIXME: Binding element 'onClick' implicitly has an 'any' ... Remove this comment to see the full error message
                            onClick,
                          Severity: Minor
                          Found in src/components/Button/Button.tsx - 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 SimpleModal has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                          const SimpleModal = ({ children, closeAction }) => {
                            const modalRef = useRef(null)
                            const containerRef = useRef(null)
                            const {
                              AnimationWrapper,
                          Severity: Minor
                          Found in src/components/SimpleModal/SimpleModal.tsx - 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 ExampleSelectWithSelectAll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export default function ExampleSelectWithSelectAll() {
                            const [items, setItems] = useState(data)
                          
                            // @ts-expect-error TS(7006) FIXME: Parameter 'option' implicitly has an 'any' type.
                            const handleClick = (option) => {
                          Severity: Minor
                          Found in src/documentation/examples/Select/SelectWithSelectAll.tsx - About 35 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