Floppy/dataslate

View on GitHub

Showing 242 of 242 total issues

Function ShootingPhaseDetails has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function ShootingPhaseDetails (props: Props): JSX.Element {
  return (
    <Row style={{
      pageBreakInside: 'avoid'
    }}
Severity: Minor
Found in src/components/WH40k9e/ShootingPhaseDetails.tsx - About 1 hr to fix

    Function WeaponList has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function WeaponList (props: Props): JSX.Element {
      const weapons = props.phase === 'shooting'
        ? props.weapons.filter((x) => (x.type !== 'Melee'))
        : props.weapons.filter((x) => (x.type === 'Melee'))
    
    
    Severity: Minor
    Found in src/components/KillTeam2018/WeaponList.tsx - About 1 hr to fix

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

      export function hasScoutingPhase (model: Model): boolean {
        return ((model.abilities.filter((x) => (x.phases?.includes('scouting')))).length > 0)
      }
      Severity: Major
      Found in src/components/KillTeam2018/ScoutingPhaseDetails.tsx and 2 other locations - About 1 hr to fix
      src/components/KillTeam2018/DeploymentPhaseDetails.tsx on lines 22..24
      src/components/KillTeam2018/InitiativePhaseDetails.tsx on lines 22..24

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

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

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

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

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

      Refactorings

      Further Reading

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

      export function hasInitiativePhase (model: Model): boolean {
        return ((model.abilities.filter((x) => (x.phases?.includes('initiative')))).length > 0)
      }
      Severity: Major
      Found in src/components/KillTeam2018/InitiativePhaseDetails.tsx and 2 other locations - About 1 hr to fix
      src/components/KillTeam2018/DeploymentPhaseDetails.tsx on lines 22..24
      src/components/KillTeam2018/ScoutingPhaseDetails.tsx on lines 22..24

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

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

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

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

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

      Refactorings

      Further Reading

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

      export function hasDeploymentPhase (model: Model): boolean {
        return ((model.abilities.filter((x) => (x.phases?.includes('deployment')))).length > 0)
      }
      Severity: Major
      Found in src/components/KillTeam2018/DeploymentPhaseDetails.tsx and 2 other locations - About 1 hr to fix
      src/components/KillTeam2018/InitiativePhaseDetails.tsx on lines 22..24
      src/components/KillTeam2018/ScoutingPhaseDetails.tsx on lines 22..24

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

      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

                    ? <StatBadge name='Inv' value={`${profile.profileStats.invulnerable_save}`} secondaryValue='++' key={`badge-inv-${profile.id}`} />
      Severity: Major
      Found in src/components/WH40k9e/ShootingPhaseDetails.tsx and 1 other location - About 1 hr to fix
      src/components/WH40k9e/ShootingPhaseDetails.tsx on lines 34..34

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

      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

                <StatBadge name='BS' value={`${profile.profileStats.ballistic_skill}`} secondaryValue='+' key={`badge-bs-${profile.id}`} />
      Severity: Major
      Found in src/components/WH40k9e/ShootingPhaseDetails.tsx and 1 other location - About 1 hr to fix
      src/components/WH40k9e/ShootingPhaseDetails.tsx on lines 43..43

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

      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 tacticalPloys: Ploy[] = [
        {
          name: 'Reanimation Protocols',
          cost: 0,
          description: `Use this Tactical Ploy when a friendly TOMB WORLD💀 operative is incapacitated. Before removing that operative from the killzone, place a Reanimation token
      Severity: Major
      Found in src/components/KillTeam2021/data/tombWorld.ts and 4 other locations - About 1 hr to fix
      src/components/KillTeam2021/data/commorrite.ts on lines 37..53
      src/components/KillTeam2021/data/forgeWorld.ts on lines 47..60
      src/components/KillTeam2021/data/greyKnights.ts on lines 33..46
      src/components/KillTeam2021/data/hunterCadre.ts on lines 41..57

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 60.

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

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

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

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

      Refactorings

      Further Reading

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

      const tacticalPloys: Ploy[] = [
        {
          name: 'Power From Pain',
          cost: 1,
          description: `Use this Tactical Ploy when an enemy operative is incapacitated. Before it is removed from the killzone, select on ready friendly COMMORRITE💀 operative that enemy operative
      Severity: Major
      Found in src/components/KillTeam2021/data/commorrite.ts and 4 other locations - About 1 hr to fix
      src/components/KillTeam2021/data/forgeWorld.ts on lines 47..60
      src/components/KillTeam2021/data/greyKnights.ts on lines 33..46
      src/components/KillTeam2021/data/hunterCadre.ts on lines 41..57
      src/components/KillTeam2021/data/tombWorld.ts on lines 43..63

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 60.

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

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

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

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

      Refactorings

      Further Reading

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

      const tacticalPloys: Ploy[] = [
        {
          name: 'Neurostatic Interference',
          cost: 1,
          description: `Use this Tactical Ploy at the start of the Firefight phase. Select one enemy operative Visible to and within ⬟ of a friendly FORGE WORLD💀 operative. Until the end
      Severity: Major
      Found in src/components/KillTeam2021/data/forgeWorld.ts and 4 other locations - About 1 hr to fix
      src/components/KillTeam2021/data/commorrite.ts on lines 37..53
      src/components/KillTeam2021/data/greyKnights.ts on lines 33..46
      src/components/KillTeam2021/data/hunterCadre.ts on lines 41..57
      src/components/KillTeam2021/data/tombWorld.ts on lines 43..63

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 60.

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

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

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

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

      Refactorings

      Further Reading

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

      const tacticalPloys: Ploy[] = [
        {
          name: 'Supporting Fire',
          cost: 1,
          description: `Use this Tactical Ploy in the Firefight phase, when a **Shoot** action is declared for a friendly HUNTER CADRE💀 operative.In the Select Valid Target step of that
      Severity: Major
      Found in src/components/KillTeam2021/data/hunterCadre.ts and 4 other locations - About 1 hr to fix
      src/components/KillTeam2021/data/commorrite.ts on lines 37..53
      src/components/KillTeam2021/data/forgeWorld.ts on lines 47..60
      src/components/KillTeam2021/data/greyKnights.ts on lines 33..46
      src/components/KillTeam2021/data/tombWorld.ts on lines 43..63

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 60.

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

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

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

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

      Refactorings

      Further Reading

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

      const tacticalPloys: Ploy[] = [
        {
          name: 'Only in death does duty end',
          cost: 1,
          description: `Use this Tactical Ploy when a ready friendly GREY KNIGHT💀 operative is incapacitated. That operative is not removed from the killzone until the end of your next
      Severity: Major
      Found in src/components/KillTeam2021/data/greyKnights.ts and 4 other locations - About 1 hr to fix
      src/components/KillTeam2021/data/commorrite.ts on lines 37..53
      src/components/KillTeam2021/data/forgeWorld.ts on lines 47..60
      src/components/KillTeam2021/data/hunterCadre.ts on lines 41..57
      src/components/KillTeam2021/data/tombWorld.ts on lines 43..63

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 60.

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

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

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

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

      Refactorings

      Further Reading

      Function registerValidSW has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function registerValidSW (swUrl, config) {
        navigator.serviceWorker
          .register(swUrl)
          .then(registration => {
            registration.onupdatefound = () => {
      Severity: Minor
      Found in src/serviceWorker.js - About 1 hr to fix

        Function Phase has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function Phase (props: Props): JSX.Element {
          return (
            <div
              className={`phase-${props.name}`} style={{
                pageBreakInside: props.name === '' ? 'auto' : 'avoid'
        Severity: Minor
        Found in src/components/WH40k9e/Phase.tsx - About 1 hr to fix

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

          export function AbilityList (props: Props): JSX.Element {
            let abilities = props.abilities
            if (typeof (props.phase) === 'string') {
              abilities = props.phase !== ''
                ? props.abilities.filter((x) => (x.phases?.includes(props.phase as string)))
          Severity: Minor
          Found in src/components/WH40k9e/AbilityList.tsx - About 1 hr to fix

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

            export function PloysColumn (props: Props): JSX.Element {
              return (
                <Col>
                  {props.ploys.map((x: Ploy) => (
                    <Card key={x.name} border='info' bg='light'>

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

              export function StratagemList (props: Props): JSX.Element {
                // Find stratagems for this phase
                const stratagems = props.phase !== ''
                  ? props.stratagems.filter((x) => (x.phases?.includes(props.phase)))
                  : props.stratagems.filter((x) => (x.phases?.length === 0))
              Severity: Minor
              Found in src/components/WH40k9e/StratagemList.tsx - About 1 hr to fix

                Function DataDevPage has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const DataDevPage: FC = () => {
                  const [faction, setFaction] = useState<string | null>(null)
                
                  const Content: FC = () => {
                    if (faction === null) {
                Severity: Minor
                Found in src/components/KillTeam2021/DataDevPage.tsx - About 1 hr to fix

                  Function WeaponList has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function WeaponList (props: Props): JSX.Element {
                    return (
                      <>
                        <Table striped bordered size='sm'>
                          <thead>
                  Severity: Minor
                  Found in src/components/KillTeam2021/WeaponList.tsx - About 1 hr to fix

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

                    export function PsychicPowerList (props: Props): JSX.Element {
                      return props.powers.length === 0
                        ? <></>
                        : (
                          <Table striped bordered size='sm'>
                    Severity: Minor
                    Found in src/components/WH40k9e/PsychicPowerList.tsx - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language