ujh/fountainpencompanion

View on GitHub

Showing 401 of 401 total issues

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

        {isVisible("price") ? (
          <>
            <div className="small text-secondary">Price</div>
            <Card.Text>{price}</Card.Text>
          </>
Severity: Major
Found in app/javascript/src/collected_pens/cards/PenCard.jsx and 9 other locations - About 1 hr to fix
app/javascript/src/collected_inks/cards/SwabCard.jsx on lines 87..92
app/javascript/src/collected_inks/cards/SwabCard.jsx on lines 93..98
app/javascript/src/collected_pens/cards/PenCard.jsx on lines 56..61
app/javascript/src/collected_pens/cards/PenCard.jsx on lines 62..67
app/javascript/src/collected_pens/cards/PenCard.jsx on lines 68..73
app/javascript/src/collected_pens/cards/PenCard.jsx on lines 74..79
app/javascript/src/collected_pens/cards/PenCard.jsx on lines 80..85
app/javascript/src/currently_inked/cards/CurrentlyInkedCard.jsx on lines 67..72
app/javascript/src/currently_inked/cards/CurrentlyInkedCard.jsx on lines 89..94

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

    const expected = [
      { values: { swabbed: false } },
      { values: { swabbed: true } },
      { values: { swabbed: true } },
      { values: { swabbed: true } }
Severity: Major
Found in app/javascript/src/collected_inks/table/sort.spec.js and 1 other location - About 1 hr to fix
app/javascript/src/collected_inks/table/sort.spec.js on lines 26..31

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

    const input = [
      { values: { swabbed: true } },
      { values: { swabbed: false } },
      { values: { swabbed: true } },
      { values: { swabbed: true } }
Severity: Major
Found in app/javascript/src/collected_inks/table/sort.spec.js and 1 other location - About 1 hr to fix
app/javascript/src/collected_inks/table/sort.spec.js on lines 33..38

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

          <button
            type="button"
            title="Configure visible fields"
            className="btn btn-sm btn-outline-secondary dropdown-toggle"
            data-bs-toggle="dropdown"
Severity: Major
Found in app/javascript/src/collected_inks/components/Actions.jsx and 2 other locations - About 1 hr to fix
app/javascript/src/collected_pens/components/Actions.jsx on lines 43..52
app/javascript/src/currently_inked/components/Actions.jsx on lines 43..52

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

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

          <button
            type="button"
            title="Configure visible fields"
            className="btn btn-sm btn-outline-secondary dropdown-toggle"
            data-bs-toggle="dropdown"
Severity: Major
Found in app/javascript/src/currently_inked/components/Actions.jsx and 2 other locations - About 1 hr to fix
app/javascript/src/collected_inks/components/Actions.jsx on lines 45..54
app/javascript/src/collected_pens/components/Actions.jsx on lines 43..52

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

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

          <button
            type="button"
            title="Configure visible fields"
            className="btn btn-sm btn-outline-secondary dropdown-toggle"
            data-bs-toggle="dropdown"
Severity: Major
Found in app/javascript/src/collected_pens/components/Actions.jsx and 2 other locations - About 1 hr to fix
app/javascript/src/collected_inks/components/Actions.jsx on lines 45..54
app/javascript/src/currently_inked/components/Actions.jsx on lines 43..52

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

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 const CurrentlyInkedSummaryWidget = ({ renderWhenInvisible }) => (
  <Widget
    header="Currently inked"
    path="/dashboard/widgets/currently_inked_summary.json"
    withLinks
app/javascript/src/dashboard/inks_summary_widget.jsx on lines 5..14
app/javascript/src/dashboard/pens_summary_widget.jsx on lines 5..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 59.

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 const InksSummaryWidget = ({ renderWhenInvisible }) => (
  <Widget
    header="Inks"
    path="/dashboard/widgets/inks_summary.json"
    withLinks
Severity: Major
Found in app/javascript/src/dashboard/inks_summary_widget.jsx and 2 other locations - About 1 hr to fix
app/javascript/src/dashboard/currently_inked_summary_widget.jsx on lines 5..14
app/javascript/src/dashboard/pens_summary_widget.jsx on lines 5..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 59.

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 const PensSummaryWidget = ({ renderWhenInvisible }) => (
  <Widget
    header="Pens"
    path="/dashboard/widgets/pens_summary.json"
    withLinks
Severity: Major
Found in app/javascript/src/dashboard/pens_summary_widget.jsx and 2 other locations - About 1 hr to fix
app/javascript/src/dashboard/currently_inked_summary_widget.jsx on lines 5..14
app/javascript/src/dashboard/inks_summary_widget.jsx on lines 5..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 59.

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

export const CollectedInks = () => {
  const [data, setData] = useState(null);
  useEffect(() => {
    fetch("/admins/graphs/collected-inks.json")
      .then((res) => res.json())
Severity: Minor
Found in app/javascript/src/admin/graphs/CollectedInks.jsx - About 1 hr to fix

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

    export const UsageRecords = () => {
      const [data, setData] = useState(null);
      useEffect(() => {
        fetch("/admins/graphs/usage-records.json")
          .then((res) => res.json())
    Severity: Minor
    Found in app/javascript/src/admin/graphs/UsageRecords.jsx - About 1 hr to fix

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

        function run(page = 1) {
          loadMacroClusterPage(page).then((json) => {
            const pagination = json.meta.pagination;
            dispatch({
              type: SET_LOADING_PERCENTAGE,
      Severity: Minor
      Found in app/javascript/src/admin/pens-model-micro-clusters/macroClusters.js - About 1 hr to fix

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

        export const BotSignUps = () => {
          const [data, setData] = useState(null);
          useEffect(() => {
            fetch("/admins/graphs/bot-signups.json")
              .then((res) => res.json())
        Severity: Minor
        Found in app/javascript/src/admin/graphs/BotSignUps.jsx - About 1 hr to fix

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

          export const CollectedPens = () => {
            const [data, setData] = useState(null);
            useEffect(() => {
              fetch("/admins/graphs/collected-pens.json")
                .then((res) => res.json())
          Severity: Minor
          Found in app/javascript/src/admin/graphs/CollectedPens.jsx - About 1 hr to fix

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

            export const SignUps = () => {
              const [data, setData] = useState(null);
              useEffect(() => {
                fetch("/admins/graphs/signups.json")
                  .then((res) => res.json())
            Severity: Minor
            Found in app/javascript/src/admin/graphs/SignUps.jsx - About 1 hr to fix

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

                function run(page = 1) {
                  loadMacroClusterPage(page).then((json) => {
                    const pagination = json.meta.pagination;
                    dispatch({
                      type: SET_LOADING_PERCENTAGE,
              Severity: Minor
              Found in app/javascript/src/admin/pens-micro-clusters/macroClusters.js - About 1 hr to fix

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

                  function run(page = 1) {
                    loadMacroClusterPage(page).then((json) => {
                      const pagination = json.meta.pagination;
                      dispatch({
                        type: SET_LOADING_PERCENTAGE,
                Severity: Minor
                Found in app/javascript/src/admin/micro-clusters/macroClusters.js - About 1 hr to fix

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

                  export const createMacroClusterAndAssign = (
                    values,
                    microClusterId,
                    dispatch,
                    afterCreate
                  Severity: Minor
                  Found in app/javascript/src/admin/pens-micro-clusters/macroClusters.js - About 1 hr to fix

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

                    export const CurrentlyInked = () => {
                      const [data, setData] = useState(null);
                      useEffect(() => {
                        fetch("/admins/graphs/currently-inked.json")
                          .then((res) => res.json())
                    Severity: Minor
                    Found in app/javascript/src/admin/graphs/CurrentlyInked.jsx - About 1 hr to fix

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

                      export const createMacroClusterAndAssign = (
                        values,
                        microClusterId,
                        dispatch,
                        afterCreate
                      Severity: Minor
                      Found in app/javascript/src/admin/pens-model-micro-clusters/macroClusters.js - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language