kleros/kleros-v2

View on GitHub

Showing 1,220 of 1,343 total issues

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

        Update: {
          chainId?: number;
          claimer?: string;
          expiration?: number;
          pohId?: string;
Severity: Major
Found in web/src/types/supabase-datalake.ts and 2 other locations - About 45 mins to fix
web/src/types/supabase-datalake.ts on lines 178..185
web/src/types/supabase-datalake.ts on lines 186..193

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

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

async function main() {
  await relayer(
    hre.config.networks.sepolia as HttpNetworkConfig,
    hre.companionNetworks.foreignSepolia.deployments,
    "ForeignGatewayOnEthereum",
Severity: Minor
Found in contracts/scripts/disputeRelayerBotFromSepolia.ts and 1 other location - About 45 mins to fix
contracts/scripts/disputeRelayerBotFromHardhat.ts on lines 5..12

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

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

deployArbitration.skip = async ({ network }) => {
  return isSkipped(network, !HomeChains[network.config.chainId ?? 0]);
};
Severity: Major
Found in contracts/deploy/00-home-chain-arbitration-neo.ts and 15 other locations - About 40 mins to fix
contracts/deploy/00-ethereum-pnk.ts on lines 27..29
contracts/deploy/00-home-chain-arbitrable.ts on lines 49..51
contracts/deploy/00-home-chain-arbitration-ruler.ts on lines 77..79
contracts/deploy/00-home-chain-arbitration-university.ts on lines 97..99
contracts/deploy/00-home-chain-arbitration.ts on lines 104..106
contracts/deploy/00-home-chain-pnk-faucet.ts on lines 37..39
contracts/deploy/00-rng.ts on lines 42..44
contracts/deploy/00-transaction-batcher.ts on lines 22..24
contracts/deploy/01-foreign-gateway-on-ethereum.ts on lines 51..53
contracts/deploy/01-foreign-gateway-on-gnosis.ts on lines 55..57
contracts/deploy/04-foreign-arbitrable.ts on lines 62..64
contracts/deploy/04-klerosliquid-to-v2-gnosis.ts on lines 146..148
contracts/deploy/fix1148.ts on lines 53..55
contracts/deploy/upgrade-kleros-core.ts on lines 46..48
contracts/deploy/upgrade-sortition-module.ts on lines 39..41

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

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

deployArbitration.skip = async ({ network }) => {
  return isSkipped(network, !HomeChains[network.config.chainId ?? 0]);
};
Severity: Major
Found in contracts/deploy/00-home-chain-arbitration-ruler.ts and 15 other locations - About 40 mins to fix
contracts/deploy/00-ethereum-pnk.ts on lines 27..29
contracts/deploy/00-home-chain-arbitrable.ts on lines 49..51
contracts/deploy/00-home-chain-arbitration-neo.ts on lines 132..134
contracts/deploy/00-home-chain-arbitration-university.ts on lines 97..99
contracts/deploy/00-home-chain-arbitration.ts on lines 104..106
contracts/deploy/00-home-chain-pnk-faucet.ts on lines 37..39
contracts/deploy/00-rng.ts on lines 42..44
contracts/deploy/00-transaction-batcher.ts on lines 22..24
contracts/deploy/01-foreign-gateway-on-ethereum.ts on lines 51..53
contracts/deploy/01-foreign-gateway-on-gnosis.ts on lines 55..57
contracts/deploy/04-foreign-arbitrable.ts on lines 62..64
contracts/deploy/04-klerosliquid-to-v2-gnosis.ts on lines 146..148
contracts/deploy/fix1148.ts on lines 53..55
contracts/deploy/upgrade-kleros-core.ts on lines 46..48
contracts/deploy/upgrade-sortition-module.ts on lines 39..41

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

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

deployArbitration.skip = async ({ network }) => {
  return isSkipped(network, !HomeChains[network.config.chainId ?? 0]);
};
Severity: Major
Found in contracts/deploy/00-transaction-batcher.ts and 15 other locations - About 40 mins to fix
contracts/deploy/00-ethereum-pnk.ts on lines 27..29
contracts/deploy/00-home-chain-arbitrable.ts on lines 49..51
contracts/deploy/00-home-chain-arbitration-neo.ts on lines 132..134
contracts/deploy/00-home-chain-arbitration-ruler.ts on lines 77..79
contracts/deploy/00-home-chain-arbitration-university.ts on lines 97..99
contracts/deploy/00-home-chain-arbitration.ts on lines 104..106
contracts/deploy/00-home-chain-pnk-faucet.ts on lines 37..39
contracts/deploy/00-rng.ts on lines 42..44
contracts/deploy/01-foreign-gateway-on-ethereum.ts on lines 51..53
contracts/deploy/01-foreign-gateway-on-gnosis.ts on lines 55..57
contracts/deploy/04-foreign-arbitrable.ts on lines 62..64
contracts/deploy/04-klerosliquid-to-v2-gnosis.ts on lines 146..148
contracts/deploy/fix1148.ts on lines 53..55
contracts/deploy/upgrade-kleros-core.ts on lines 46..48
contracts/deploy/upgrade-sortition-module.ts on lines 39..41

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

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

deployArbitration.skip = async ({ network }) => {
  return isSkipped(network, !HomeChains[network.config.chainId ?? 0]);
};
Severity: Major
Found in contracts/deploy/00-home-chain-arbitration-university.ts and 15 other locations - About 40 mins to fix
contracts/deploy/00-ethereum-pnk.ts on lines 27..29
contracts/deploy/00-home-chain-arbitrable.ts on lines 49..51
contracts/deploy/00-home-chain-arbitration-neo.ts on lines 132..134
contracts/deploy/00-home-chain-arbitration-ruler.ts on lines 77..79
contracts/deploy/00-home-chain-arbitration.ts on lines 104..106
contracts/deploy/00-home-chain-pnk-faucet.ts on lines 37..39
contracts/deploy/00-rng.ts on lines 42..44
contracts/deploy/00-transaction-batcher.ts on lines 22..24
contracts/deploy/01-foreign-gateway-on-ethereum.ts on lines 51..53
contracts/deploy/01-foreign-gateway-on-gnosis.ts on lines 55..57
contracts/deploy/04-foreign-arbitrable.ts on lines 62..64
contracts/deploy/04-klerosliquid-to-v2-gnosis.ts on lines 146..148
contracts/deploy/fix1148.ts on lines 53..55
contracts/deploy/upgrade-kleros-core.ts on lines 46..48
contracts/deploy/upgrade-sortition-module.ts on lines 39..41

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

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

const Container = styled.div`
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 12px;
Severity: Major
Found in web/src/pages/Dashboard/Courts/Header.tsx and 4 other locations - About 40 mins to fix
web/src/components/Popup/MiniGuides/PageContentsTemplate.tsx on lines 25..32
web/src/pages/Cases/CaseDetails/Voting/VotesDetails/AccordionTitle.tsx on lines 14..26
web/src/pages/Courts/CourtDetails/Stats.tsx on lines 27..41
web/src/pages/Dashboard/JurorInfo/Header.tsx on lines 14..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 49.

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

const StyledCard = styled.div`
  width: auto;
  height: fit-content;
  display: grid;
  gap: 32px;
Severity: Major
Found in web/src/pages/Courts/CourtDetails/Stats.tsx and 4 other locations - About 40 mins to fix
web/src/components/Popup/MiniGuides/PageContentsTemplate.tsx on lines 25..32
web/src/pages/Cases/CaseDetails/Voting/VotesDetails/AccordionTitle.tsx on lines 14..26
web/src/pages/Dashboard/Courts/Header.tsx on lines 15..29
web/src/pages/Dashboard/JurorInfo/Header.tsx on lines 14..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 49.

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

export const StyledImage = styled.div`
  width: ${responsiveSize(260, 460)};
  ${landscapeStyle(
    () => css`
      width: 389px;
Severity: Major
Found in web/src/components/Popup/MiniGuides/PageContentsTemplate.tsx and 4 other locations - About 40 mins to fix
web/src/pages/Cases/CaseDetails/Voting/VotesDetails/AccordionTitle.tsx on lines 14..26
web/src/pages/Courts/CourtDetails/Stats.tsx on lines 27..41
web/src/pages/Dashboard/Courts/Header.tsx on lines 15..29
web/src/pages/Dashboard/JurorInfo/Header.tsx on lines 14..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 49.

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

const Container = styled.div`
  display: flex;
  gap: 0px;
  flex-direction: column;

Severity: Major
Found in web/src/layout/Header/navbar/Explore.tsx and 2 other locations - About 40 mins to fix
web/src/components/CasesDisplay/Search.tsx on lines 18..30
web/src/components/StatDisplay.tsx on lines 7..18

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

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

const Container = styled.div`
  display: flex;
  flex-direction: column;
  gap: 4px;

Severity: Major
Found in web/src/components/CasesDisplay/Search.tsx and 2 other locations - About 40 mins to fix
web/src/components/StatDisplay.tsx on lines 7..18
web/src/layout/Header/navbar/Explore.tsx on lines 11..22

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

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

const Container = styled.div`
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  margin-bottom: ${responsiveSize(32, 48)};
Severity: Major
Found in web/src/pages/Dashboard/JurorInfo/Header.tsx and 4 other locations - About 40 mins to fix
web/src/components/Popup/MiniGuides/PageContentsTemplate.tsx on lines 25..32
web/src/pages/Cases/CaseDetails/Voting/VotesDetails/AccordionTitle.tsx on lines 14..26
web/src/pages/Courts/CourtDetails/Stats.tsx on lines 27..41
web/src/pages/Dashboard/Courts/Header.tsx on lines 15..29

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

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

const Container = styled.div`
  display: flex;
  max-width: 196px;
  align-items: center;
  gap: 8px;
Severity: Major
Found in web/src/components/StatDisplay.tsx and 2 other locations - About 40 mins to fix
web/src/components/CasesDisplay/Search.tsx on lines 18..30
web/src/layout/Header/navbar/Explore.tsx on lines 11..22

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

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

const TitleContainer = styled.div`
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: ${responsiveSize(8, 12)};
web/src/components/Popup/MiniGuides/PageContentsTemplate.tsx on lines 25..32
web/src/pages/Courts/CourtDetails/Stats.tsx on lines 27..41
web/src/pages/Dashboard/Courts/Header.tsx on lines 15..29
web/src/pages/Dashboard/JurorInfo/Header.tsx on lines 14..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 49.

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

      tg_users_subscribed_to: {
        Args: {
          vals: string[];
        };
        Returns: {
Severity: Minor
Found in web/src/types/supabase-notification.ts and 1 other location - About 40 mins to fix
web/src/types/supabase-notification.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 49.

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

      get_subscribers: {
        Args: {
          vals: string[];
        };
        Returns: {
Severity: Minor
Found in web/src/types/supabase-notification.ts and 1 other location - About 40 mins to fix
web/src/types/supabase-notification.ts on lines 225..233

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

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

Consider simplifying this complex logical expression.
Open

    if (
      !(
        (netlifyUri && netlifyUri === siweMessage.uri) ||
        (netlifyDeployUri && netlifyDeployUri === siweMessage.uri) ||
        (netlifyDeployPrimeUri && netlifyDeployPrimeUri === siweMessage.uri)
Severity: Major
Found in web/netlify/functions/authUser.ts - About 40 mins to fix

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

const Field: React.FC<IField> = ({
  icon: Icon,
  name,
  value,
  link,
Severity: Minor
Found in web/src/components/Field.tsx and 1 other location - About 40 mins to fix
web/src/components/Popup/MiniGuides/MainStructureTemplate.tsx on lines 144..205

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

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 Template: React.FC<ITemplate> = ({
  onClose,
  LeftContent,
  RightContent,
  currentPage,
Severity: Minor
Found in web/src/components/Popup/MiniGuides/MainStructureTemplate.tsx and 1 other location - About 40 mins to fix
web/src/components/Field.tsx on lines 85..116

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

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 CourtCard: React.FC<ICourtCard> = ({ name, stake }) => {
  return (
    <Container>
      <CourtName name={name} />
      <Stake stake={stake} />
Severity: Minor
Found in web/src/pages/Dashboard/Courts/CourtCard/index.tsx and 1 other location - About 40 mins to fix
web/src/pages/Home/TopJurors/JurorCard/JurorTitle.tsx on lines 26..33

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

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