kleros/kleros-v2

View on GitHub

Showing 1,278 of 1,394 total issues

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

  const accordionItems = useMemo(() => {
    return drawnJurors
      .map((drawnJuror) =>
        !isUndefined(drawnJuror.vote?.justification?.choice)
          ? {
Severity: Minor
Found in web/src/pages/Cases/CaseDetails/Voting/VotesDetails/index.tsx - About 1 hr to fix

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

export function updateCountsAndGetCurrentRuling(id: string, choice: BigInt, delta: BigInt): CurrentRulingInfo {
  const round = ClassicRound.load(id);
  if (!round) return { ruling: ZERO, tied: false };
  const choiceNum = choice.toI32();
  const newChoiceCount = round.counts[choiceNum].plus(delta);
Severity: Minor
Found in subgraph/core/src/entities/ClassicRound.ts - About 1 hr to fix

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

    const expectFromDraw = async (drawTx: Promise<ContractTransactionResponse>) => {
      console.log((await core.getRoundInfo(0, 0)).drawIterations);
      expect(await core.getRoundInfo(0, 0).then((round) => round.drawIterations)).to.equal(3);

      const tx = await (await drawTx).wait();
Severity: Minor
Found in contracts/test/arbitration/draw.ts - About 1 hr to fix

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

  if (currentCore !== klerosCore.address) {
    console.log(`disputeKit.changeCore(${klerosCore.address})`);
    await disputeKitContract.changeCore(klerosCore.address);
  }
Severity: Major
Found in contracts/deploy/00-home-chain-arbitration-university.ts and 2 other locations - About 1 hr to fix
contracts/deploy/00-home-chain-arbitration-neo.ts on lines 103..106
contracts/deploy/00-home-chain-arbitration.ts on lines 100..103

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

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

const Container = styled.div`
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
Severity: Major
Found in web-devtools/src/app/(main)/(homepage)/Tools.tsx and 8 other locations - About 1 hr to fix
web-devtools/src/app/(main)/(homepage)/Tools.tsx on lines 30..40
web/src/components/HowItWorks.tsx on lines 6..26
web/src/components/Popup/MiniGuides/Onboarding/PnkLogoAndTitle.tsx on lines 27..37
web/src/layout/Header/navbar/Menu/Settings/General.tsx on lines 18..34
web/src/pages/Cases/CaseDetails/MaintenanceButtons/index.tsx on lines 30..47
web/src/pages/Cases/CaseDetails/Voting/VotesDetails/index.tsx on lines 53..61
web/src/pages/Courts/CourtDetails/StakePanel/SimulatorPopup/QuantityToSimulate.tsx on lines 18..28
web/src/pages/Courts/StakeMaintenanceButton/index.tsx on lines 21..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 56.

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

const StyledButton = styled(Button)`
  display: inline-block;
  background-color: transparent;
  padding: 0;
  .button-text {
web/src/components/LightButton.tsx on lines 6..21
web/src/pages/Cases/AttachmentDisplay/Header.tsx on lines 41..57
web/src/pages/Cases/CaseDetails/Evidence/SubmitEvidenceModal.tsx on lines 19..38
web/src/pages/Cases/CaseDetails/Voting/PendingVotesBox.tsx on lines 8..24
web/src/pages/Courts/CourtDetails/StakePanel/SimulatorPopup/Header.tsx on lines 27..36
web/src/pages/Courts/CourtDetails/Stats.tsx on lines 102..110
web/src/pages/Dashboard/Courts/CourtCard/CourtName.tsx on lines 32..47

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

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

        if (courtPresent.feeForJuror !== toBigInt(court.feeForJuror)) {
          change = true;
          console.log(
            "Court %d: changing feeForJuror from %d to %d",
            court.id,
Severity: Major
Found in contracts/scripts/populateCourts.ts and 3 other locations - About 1 hr to fix
contracts/scripts/populateCourts.ts on lines 192..195
contracts/scripts/populateCourts.ts on lines 197..200
contracts/scripts/populateCourts.ts on lines 212..220

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

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

const StyledCourtLabel = styled.label`
  font-size: 24px;
  background: linear-gradient(
    90deg,
    ${({ theme }) => theme.secondaryPurple} 0%,
web-devtools/src/app/(main)/(homepage)/Tools.tsx on lines 8..18
web-devtools/src/app/(main)/(homepage)/Tools.tsx on lines 30..40
web/src/components/HowItWorks.tsx on lines 6..26
web/src/layout/Header/navbar/Menu/Settings/General.tsx on lines 18..34
web/src/pages/Cases/CaseDetails/MaintenanceButtons/index.tsx on lines 30..47
web/src/pages/Cases/CaseDetails/Voting/VotesDetails/index.tsx on lines 53..61
web/src/pages/Courts/CourtDetails/StakePanel/SimulatorPopup/QuantityToSimulate.tsx on lines 18..28
web/src/pages/Courts/StakeMaintenanceButton/index.tsx on lines 21..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 56.

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

const JustificationText = styled.div`
  color: ${({ theme }) => theme.secondaryText};
  font-size: 16px;
  line-height: 1.2;
  &:before {
web-devtools/src/app/(main)/(homepage)/Tools.tsx on lines 8..18
web-devtools/src/app/(main)/(homepage)/Tools.tsx on lines 30..40
web/src/components/HowItWorks.tsx on lines 6..26
web/src/components/Popup/MiniGuides/Onboarding/PnkLogoAndTitle.tsx on lines 27..37
web/src/layout/Header/navbar/Menu/Settings/General.tsx on lines 18..34
web/src/pages/Cases/CaseDetails/MaintenanceButtons/index.tsx on lines 30..47
web/src/pages/Courts/CourtDetails/StakePanel/SimulatorPopup/QuantityToSimulate.tsx on lines 18..28
web/src/pages/Courts/StakeMaintenanceButton/index.tsx on lines 21..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 56.

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

const StyledButton = styled(Button)`
  background-color: transparent;
  padding-left: 0;
  .button-text {
    color: ${({ theme }) => theme.primaryText};
Severity: Major
Found in web/src/components/LightButton.tsx and 7 other locations - About 1 hr to fix
web/src/layout/Header/navbar/Menu/Settings/Notifications/FormContactDetails/EmailVerificationInfo.tsx on lines 39..57
web/src/pages/Cases/AttachmentDisplay/Header.tsx on lines 41..57
web/src/pages/Cases/CaseDetails/Evidence/SubmitEvidenceModal.tsx on lines 19..38
web/src/pages/Cases/CaseDetails/Voting/PendingVotesBox.tsx on lines 8..24
web/src/pages/Courts/CourtDetails/StakePanel/SimulatorPopup/Header.tsx on lines 27..36
web/src/pages/Courts/CourtDetails/Stats.tsx on lines 102..110
web/src/pages/Dashboard/Courts/CourtCard/CourtName.tsx on lines 32..47

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

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

const StyledButton = styled(Button)`
  background-color: transparent;
  padding: 0;
  .button-text {
    color: ${({ theme }) => theme.primaryBlue};
Severity: Major
Found in web/src/pages/Cases/AttachmentDisplay/Header.tsx and 7 other locations - About 1 hr to fix
web/src/components/LightButton.tsx on lines 6..21
web/src/layout/Header/navbar/Menu/Settings/Notifications/FormContactDetails/EmailVerificationInfo.tsx on lines 39..57
web/src/pages/Cases/CaseDetails/Evidence/SubmitEvidenceModal.tsx on lines 19..38
web/src/pages/Cases/CaseDetails/Voting/PendingVotesBox.tsx on lines 8..24
web/src/pages/Courts/CourtDetails/StakePanel/SimulatorPopup/Header.tsx on lines 27..36
web/src/pages/Courts/CourtDetails/Stats.tsx on lines 102..110
web/src/pages/Dashboard/Courts/CourtCard/CourtName.tsx on lines 32..47

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

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

const Container = styled.div`
  display: flex;
  align-items: center;
  gap: 8px;
  color: ${({ theme }) => theme.primaryBlue};
Severity: Major
Found in web/src/components/HowItWorks.tsx and 8 other locations - About 1 hr to fix
web-devtools/src/app/(main)/(homepage)/Tools.tsx on lines 8..18
web-devtools/src/app/(main)/(homepage)/Tools.tsx on lines 30..40
web/src/components/Popup/MiniGuides/Onboarding/PnkLogoAndTitle.tsx on lines 27..37
web/src/layout/Header/navbar/Menu/Settings/General.tsx on lines 18..34
web/src/pages/Cases/CaseDetails/MaintenanceButtons/index.tsx on lines 30..47
web/src/pages/Cases/CaseDetails/Voting/VotesDetails/index.tsx on lines 53..61
web/src/pages/Courts/CourtDetails/StakePanel/SimulatorPopup/QuantityToSimulate.tsx on lines 18..28
web/src/pages/Courts/StakeMaintenanceButton/index.tsx on lines 21..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 56.

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

const StyledChainContainer = styled.div`
  display: flex;
  height: 34px;
  gap: 0.5rem;
  justify-content: center;
Severity: Major
Found in web/src/layout/Header/navbar/Menu/Settings/General.tsx and 8 other locations - About 1 hr to fix
web-devtools/src/app/(main)/(homepage)/Tools.tsx on lines 8..18
web-devtools/src/app/(main)/(homepage)/Tools.tsx on lines 30..40
web/src/components/HowItWorks.tsx on lines 6..26
web/src/components/Popup/MiniGuides/Onboarding/PnkLogoAndTitle.tsx on lines 27..37
web/src/pages/Cases/CaseDetails/MaintenanceButtons/index.tsx on lines 30..47
web/src/pages/Cases/CaseDetails/Voting/VotesDetails/index.tsx on lines 53..61
web/src/pages/Courts/CourtDetails/StakePanel/SimulatorPopup/QuantityToSimulate.tsx on lines 18..28
web/src/pages/Courts/StakeMaintenanceButton/index.tsx on lines 21..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 56.

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

  if (currentCore !== klerosCore.address) {
    console.log(`disputeKit.changeCore(${klerosCore.address})`);
    await disputeKitContract.changeCore(klerosCore.address);
  }
Severity: Major
Found in contracts/deploy/00-home-chain-arbitration-neo.ts and 2 other locations - About 1 hr to fix
contracts/deploy/00-home-chain-arbitration-university.ts on lines 69..72
contracts/deploy/00-home-chain-arbitration.ts on lines 100..103

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

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

const ToolItem = styled.li`
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 16px;
Severity: Major
Found in web-devtools/src/app/(main)/(homepage)/Tools.tsx and 8 other locations - About 1 hr to fix
web-devtools/src/app/(main)/(homepage)/Tools.tsx on lines 8..18
web/src/components/HowItWorks.tsx on lines 6..26
web/src/components/Popup/MiniGuides/Onboarding/PnkLogoAndTitle.tsx on lines 27..37
web/src/layout/Header/navbar/Menu/Settings/General.tsx on lines 18..34
web/src/pages/Cases/CaseDetails/MaintenanceButtons/index.tsx on lines 30..47
web/src/pages/Cases/CaseDetails/Voting/VotesDetails/index.tsx on lines 53..61
web/src/pages/Courts/CourtDetails/StakePanel/SimulatorPopup/QuantityToSimulate.tsx on lines 18..28
web/src/pages/Courts/StakeMaintenanceButton/index.tsx on lines 21..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 56.

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

const StyledPNKLogo = styled(PNKLogo)`
  width: 32px;
  height: 32px;
  [class$="stop-1"] {
    stop-color: ${({ theme }) => theme.primaryBlue};
web/src/components/LightButton.tsx on lines 6..21
web/src/layout/Header/navbar/Menu/Settings/Notifications/FormContactDetails/EmailVerificationInfo.tsx on lines 39..57
web/src/pages/Cases/AttachmentDisplay/Header.tsx on lines 41..57
web/src/pages/Cases/CaseDetails/Evidence/SubmitEvidenceModal.tsx on lines 19..38
web/src/pages/Cases/CaseDetails/Voting/PendingVotesBox.tsx on lines 8..24
web/src/pages/Courts/CourtDetails/Stats.tsx on lines 102..110
web/src/pages/Dashboard/Courts/CourtCard/CourtName.tsx on lines 32..47

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

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

        if (courtPresent.jurorsForCourtJump !== toBigInt(court.jurorsForCourtJump)) {
          change = true;
          console.log(
            "Court %d: changing jurorsForCourtJump from %d to %d",
            court.id,
Severity: Major
Found in contracts/scripts/populateCourts.ts and 3 other locations - About 1 hr to fix
contracts/scripts/populateCourts.ts on lines 192..195
contracts/scripts/populateCourts.ts on lines 197..200
contracts/scripts/populateCourts.ts on lines 202..210

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

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

        if (courtPresent.minStake !== toBigInt(court.minStake)) {
          change = true;
          console.log("Court %d: changing minStake from %d to %d", court.id, courtPresent.minStake, court.minStake);
        }
Severity: Major
Found in contracts/scripts/populateCourts.ts and 3 other locations - About 1 hr to fix
contracts/scripts/populateCourts.ts on lines 197..200
contracts/scripts/populateCourts.ts on lines 202..210
contracts/scripts/populateCourts.ts on lines 212..220

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

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

const TextWithTooltipContainer = styled.div`
  color: ${({ theme }) => theme.secondaryPurple};
  font-size: 14px;

  > div {
web-devtools/src/app/(main)/(homepage)/Tools.tsx on lines 8..18
web-devtools/src/app/(main)/(homepage)/Tools.tsx on lines 30..40
web/src/components/HowItWorks.tsx on lines 6..26
web/src/components/Popup/MiniGuides/Onboarding/PnkLogoAndTitle.tsx on lines 27..37
web/src/layout/Header/navbar/Menu/Settings/General.tsx on lines 18..34
web/src/pages/Cases/CaseDetails/MaintenanceButtons/index.tsx on lines 30..47
web/src/pages/Cases/CaseDetails/Voting/VotesDetails/index.tsx on lines 53..61
web/src/pages/Courts/StakeMaintenanceButton/index.tsx on lines 21..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 56.

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

const PopupContainer = styled.div`
  display: flex;
  flex-direction: column;
  position: absolute;
  height: fit-content;
Severity: Major
Found in web/src/pages/Courts/StakeMaintenanceButton/index.tsx and 8 other locations - About 1 hr to fix
web-devtools/src/app/(main)/(homepage)/Tools.tsx on lines 8..18
web-devtools/src/app/(main)/(homepage)/Tools.tsx on lines 30..40
web/src/components/HowItWorks.tsx on lines 6..26
web/src/components/Popup/MiniGuides/Onboarding/PnkLogoAndTitle.tsx on lines 27..37
web/src/layout/Header/navbar/Menu/Settings/General.tsx on lines 18..34
web/src/pages/Cases/CaseDetails/MaintenanceButtons/index.tsx on lines 30..47
web/src/pages/Cases/CaseDetails/Voting/VotesDetails/index.tsx on lines 53..61
web/src/pages/Courts/CourtDetails/StakePanel/SimulatorPopup/QuantityToSimulate.tsx on lines 18..28

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

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