wahanegi/vibereport

View on GitHub

Showing 248 of 274 total issues

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

    {
      showModal && <ShoutoutModal onClose = {() => {setShowModal(false)} }
                                  data={data} setData={setData} />

    }
Severity: Minor
Found in app/javascript/components/Pages/ResultsPageManager/index.js and 2 other locations - About 35 mins to fix
app/javascript/components/Pages/ResultsPage/ShoutoutSection.js on lines 71..75
app/javascript/components/Pages/ResultsPage/index.js on lines 200..204

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

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

        {...{emojiObject, setSelectedEmoji, setSelectedEmojiName, emojisArr,
          setEmojisArr, setEmojiObject, current_user, pickerPosition, setPickerPosition}} />
Severity: Minor
Found in app/javascript/components/Pages/ResultsPage/Emojis/EmojiRow.js and 1 other location - About 35 mins to fix
app/javascript/components/Pages/ResultsPage/Emojis/EmojiPicker.js on lines 65..69

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

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

    <GifList {...{gifs, gifUrl, setGifUrl, selectedGifIndex, setSelectedGifIndex, category, isCustomGif}} />
Severity: Minor
Found in app/javascript/components/Pages/Gifs/SearchResults.js and 1 other location - About 35 mins to fix
app/javascript/components/Pages/ResultsPage/Emojis/EmojiRow.js on lines 56..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 46.

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 EmojiPickerComponent = React.forwardRef(({
                        emojiObject, setSelectedEmoji, current_user, pickerPosition,
                        emojisArr, setEmojisArr, setEmojiObject, setSelectedEmojiName,
                        setPickerPosition
                      }, ref) => {
app/javascript/components/Pages/ResultsPage/Emojis/EmojiRow.js on lines 67..68

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

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

    <ShowEmojis {...{emojiObject, setSelectedEmoji, setSelectedEmojiName, emojisArr, setEmojisArr, current_user, setEmojiObject}} />
Severity: Minor
Found in app/javascript/components/Pages/ResultsPage/Emojis/EmojiRow.js and 1 other location - About 35 mins to fix
app/javascript/components/Pages/Gifs/SearchResults.js on lines 37..37

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

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

Avoid too many return statements within this function.
Open

        return 0
Severity: Major
Found in app/javascript/components/UI/rich-text/RichInputElement.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

              return
    Severity: Major
    Found in app/javascript/components/UI/rich-text/RichInputElement.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

        return <Fragment>
          <GifList {...{gifs, gifUrl, setGifUrl, selectedGifIndex, setSelectedGifIndex, category, isCustomGif}} />
        </Fragment>
      Severity: Major
      Found in app/javascript/components/Pages/Gifs/SearchResults.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return 0
        Severity: Major
        Found in app/javascript/components/UI/rich-text/RichInputElement.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return 0
          Severity: Major
          Found in app/javascript/components/UI/rich-text/RichInputElement.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                      return 0;
            Severity: Major
            Found in app/javascript/components/UI/rich-text/rich-text.js - About 30 mins to fix

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

                const handleSaveDraft = () => {
                  const dataDraft = { celebrate_comment: celebrateComment, draft: true };
                  saveDataToDb(steps, dataDraft);
                  setIsDraft(true);
                }
              Severity: Major
              Found in app/javascript/components/Pages/CausesToCelebrate.js and 3 other locations - About 30 mins to fix
              app/javascript/components/Pages/MemeSelection.js on lines 62..66
              app/javascript/components/Pages/ProductivityBadFollowUp.js on lines 13..17
              app/javascript/components/Pages/ProductivityCheckLow.js on lines 55..59

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

              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

              Avoid too many return statements within this function.
              Open

                          return 0
              Severity: Major
              Found in app/javascript/components/UI/rich-text/RichInputElement.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                          || RichText.contentBtwTags(textHTML, cursorPos, END_TAG_AT, 1).length !== cursorPos.focusOffset-1) return 0
                Severity: Major
                Found in app/javascript/components/UI/rich-text/RichInputElement.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return 0
                  Severity: Major
                  Found in app/javascript/components/UI/rich-text/RichInputElement.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return 0
                    Severity: Major
                    Found in app/javascript/components/UI/rich-text/RichInputElement.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              if (indexOfSelection === -1 ) return
                      Severity: Major
                      Found in app/javascript/components/UI/rich-text/RichInputElement.js - About 30 mins to fix

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

                              { positionRight && <img className="position-absolute" style={{right: -26, top: 29}} src={polygonRight} alt="polygon right"/> }
                        Severity: Minor
                        Found in app/javascript/components/UI/ShareContent.js and 1 other location - About 30 mins to fix
                        app/javascript/components/UI/ShareContent.js on lines 71..71

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

                        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

                              { prevTimePeriod && positionLeft && <img className="position-absolute" style={{left: -26, top: 29}} src={polygonLeft} alt="polygon left" /> }
                        Severity: Minor
                        Found in app/javascript/components/UI/ShareContent.js and 1 other location - About 30 mins to fix
                        app/javascript/components/UI/ShareContent.js on lines 72..72

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

                        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

                        Line is too long. [127/125]
                        Open

                                return_blocks = Shoutout.includes([:user]).where(time_period_id: time_period.id, public: true) - current_user.shoutouts

                        Checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/IndentationStyle cop. It also ignores a shebang line by default.

                        This cop has some autocorrection capabilities. It can programmatically shorten certain long lines by inserting line breaks into expressions that can be safely split across lines. These include arrays, hashes, and method calls with argument lists.

                        If autocorrection is enabled, the following Layout cops are recommended to further format the broken lines. (Many of these are enabled by default.)

                        • ArgumentAlignment
                        • BlockAlignment
                        • BlockDelimiters
                        • BlockEndNewline
                        • ClosingParenthesisIndentation
                        • FirstArgumentIndentation
                        • FirstArrayElementIndentation
                        • FirstHashElementIndentation
                        • FirstParameterIndentation
                        • HashAlignment
                        • IndentationWidth
                        • MultilineArrayLineBreaks
                        • MultilineBlockLayout
                        • MultilineHashBraceLayout
                        • MultilineHashKeyLineBreaks
                        • MultilineMethodArgumentLineBreaks
                        • ParameterAlignment

                        Together, these cops will pretty print hashes, arrays, method calls, etc. For example, let's say the max columns is 25:

                        Example:

                        # bad
                        {foo: "0000000000", bar: "0000000000", baz: "0000000000"}
                        
                        # good
                        {foo: "0000000000",
                        bar: "0000000000", baz: "0000000000"}
                        
                        # good (with recommended cops enabled)
                        {
                          foo: "0000000000",
                          bar: "0000000000",
                          baz: "0000000000",
                        }
                        Severity
                        Category
                        Status
                        Source
                        Language