kleros/kleros-v2

View on GitHub

Showing 1,278 of 1,394 total issues

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

const OptionsContainer = styled.div`
  display: flex;
  flex-direction: column;
  gap: 48px;
  width: 84vw;
web/src/pages/Resolver/Parameters/Court.tsx on lines 42..50
web/src/pages/Resolver/Parameters/NotablePersons/PersonFields.tsx on lines 15..26
web/src/pages/Resolver/Parameters/VotingOptions/index.tsx on lines 28..38
web/src/pages/Resolver/Policy/index.tsx on lines 32..40

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

const StyledField = styled(Field)`
  width: 84vw;

  ${landscapeStyle(
    () => css`
Severity: Major
Found in web/src/pages/Resolver/Briefing/Title.tsx and 3 other locations - About 45 mins to fix
web/src/pages/Resolver/Briefing/Description.tsx on lines 20..28
web/src/pages/Resolver/Parameters/Category.tsx on lines 27..39
web/src/pages/Resolver/Parameters/Court.tsx on lines 30..40

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

const AlertMessageContainer = styled.div`
  width: 84vw;
  ${landscapeStyle(
    () => css`
      width: ${responsiveSize(442, 700, 900)};
Severity: Major
Found in web/src/pages/Resolver/Parameters/VotingOptions/index.tsx and 4 other locations - About 45 mins to fix
web/src/pages/Resolver/Parameters/Court.tsx on lines 42..50
web/src/pages/Resolver/Parameters/NotablePersons/PersonFields.tsx on lines 15..26
web/src/pages/Resolver/Parameters/VotingOptions/OptionsFields.tsx on lines 12..23
web/src/pages/Resolver/Policy/index.tsx on lines 32..40

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

const StyledTextArea = styled(Textarea)`
  width: 84vw;
  height: 300px;
  ${landscapeStyle(
    () => css`
Severity: Major
Found in web/src/pages/Resolver/Briefing/Description.tsx and 3 other locations - About 45 mins to fix
web/src/pages/Resolver/Briefing/Title.tsx on lines 27..35
web/src/pages/Resolver/Parameters/Category.tsx on lines 27..39
web/src/pages/Resolver/Parameters/Court.tsx on lines 30..40

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

const StyledLabel = styled.label`
  width: 84vw;
  margin-bottom: 48px;
  ${landscapeStyle(
    () => css`
Severity: Major
Found in web/src/pages/Resolver/Policy/index.tsx and 4 other locations - About 45 mins to fix
web/src/pages/Resolver/Parameters/Court.tsx on lines 42..50
web/src/pages/Resolver/Parameters/NotablePersons/PersonFields.tsx on lines 15..26
web/src/pages/Resolver/Parameters/VotingOptions/OptionsFields.tsx on lines 12..23
web/src/pages/Resolver/Parameters/VotingOptions/index.tsx on lines 28..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 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 5 locations. Consider refactoring.
Open

const AlertMessageContainer = styled.div`
  width: 84vw;
  ${landscapeStyle(
    () => css`
      width: ${responsiveSize(442, 700, 900)};
Severity: Major
Found in web/src/pages/Resolver/Parameters/Court.tsx and 4 other locations - About 45 mins to fix
web/src/pages/Resolver/Parameters/NotablePersons/PersonFields.tsx on lines 15..26
web/src/pages/Resolver/Parameters/VotingOptions/OptionsFields.tsx on lines 12..23
web/src/pages/Resolver/Parameters/VotingOptions/index.tsx on lines 28..38
web/src/pages/Resolver/Policy/index.tsx on lines 32..40

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

const StyledDropdownCascader = styled(DropdownCascader)`
  width: 84vw;
  ${landscapeStyle(
    () => css`
      width: ${responsiveSize(442, 700, 900)};
Severity: Major
Found in web/src/pages/Resolver/Parameters/Court.tsx and 3 other locations - About 45 mins to fix
web/src/pages/Resolver/Briefing/Description.tsx on lines 20..28
web/src/pages/Resolver/Briefing/Title.tsx on lines 27..35
web/src/pages/Resolver/Parameters/Category.tsx on lines 27..39

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

const StyledField = styled(Field)`
  width: 84vw;
  margin-bottom: 74px;
  ${landscapeStyle(
    () => css`
Severity: Major
Found in web/src/pages/Resolver/Parameters/Category.tsx and 3 other locations - About 45 mins to fix
web/src/pages/Resolver/Briefing/Description.tsx on lines 20..28
web/src/pages/Resolver/Briefing/Title.tsx on lines 27..35
web/src/pages/Resolver/Parameters/Court.tsx on lines 30..40

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 15 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 14 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 133..135
contracts/deploy/00-home-chain-arbitration-ruler.ts on lines 62..64
contracts/deploy/00-home-chain-arbitration.ts on lines 116..118
contracts/deploy/00-home-chain-pnk-faucet.ts on lines 32..34
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 56..58
contracts/deploy/04-foreign-arbitrable.ts on lines 63..65
contracts/deploy/04-klerosliquid-to-v2-gnosis.ts on lines 147..149
contracts/deploy/fix1148.ts on lines 54..56
contracts/deploy/upgrade-kleros-core.ts on lines 45..47
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 15 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 14 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 133..135
contracts/deploy/00-home-chain-arbitration-university.ts on lines 98..100
contracts/deploy/00-home-chain-arbitration.ts on lines 116..118
contracts/deploy/00-home-chain-pnk-faucet.ts on lines 32..34
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 56..58
contracts/deploy/04-foreign-arbitrable.ts on lines 63..65
contracts/deploy/04-klerosliquid-to-v2-gnosis.ts on lines 147..149
contracts/deploy/fix1148.ts on lines 54..56
contracts/deploy/upgrade-kleros-core.ts on lines 45..47
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 4 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 3 other locations - About 40 mins to fix
web-devtools/src/layout/Header/navbar/Explore.tsx on lines 12..23
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 4 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 3 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 15..27
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 4 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 3 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 15..27
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 4 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 3 other locations - About 40 mins to fix
web-devtools/src/layout/Header/navbar/Explore.tsx on lines 12..23
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 4 locations. Consider refactoring.
Open

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

Severity: Major
Found in web-devtools/src/layout/Header/navbar/Explore.tsx and 3 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
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 4 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 3 other locations - About 40 mins to fix
web/src/pages/Cases/CaseDetails/Voting/VotesDetails/AccordionTitle.tsx on lines 15..27
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 15 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 14 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 62..64
contracts/deploy/00-home-chain-arbitration-university.ts on lines 98..100
contracts/deploy/00-home-chain-arbitration.ts on lines 116..118
contracts/deploy/00-home-chain-pnk-faucet.ts on lines 32..34
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 56..58
contracts/deploy/04-foreign-arbitrable.ts on lines 63..65
contracts/deploy/04-klerosliquid-to-v2-gnosis.ts on lines 147..149
contracts/deploy/fix1148.ts on lines 54..56
contracts/deploy/upgrade-kleros-core.ts on lines 45..47
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 4 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/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 4 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 3 other locations - About 40 mins to fix
web-devtools/src/layout/Header/navbar/Explore.tsx on lines 12..23
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

Severity
Category
Status
Source
Language