Floppy/dataslate

View on GitHub

Showing 242 of 242 total issues

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

  const handleTouchscreenModeChange = (event: any): void => {
    const target = event.target
    const touchScreenMode: boolean = target.checked
    const newSettings = {
      ...props.settings,
Severity: Major
Found in src/components/SettingsDialog.tsx and 1 other location - About 2 hrs to fix
src/components/SettingsDialog.tsx on lines 22..30

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

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 handleWoundTrackChange = (event: any): void => {
    const target = event.target
    const showWoundTrack: boolean = target.checked
    const newSettings = {
      ...props.settings,
Severity: Major
Found in src/components/SettingsDialog.tsx and 1 other location - About 2 hrs to fix
src/components/SettingsDialog.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 78.

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 tacticalPloys: Ploy[] = [
  {
    name: 'Just a scratch',
    cost: 1,
    description: `Use this tactical Ploy in the Resolve Successfull Hits step of a shooting attack or combat, when damage would beinflicked on a friendly KOMMANDO💀 operative,
Severity: Major
Found in src/components/KillTeam2021/data/kommando.ts and 1 other location - About 2 hrs to fix
src/components/KillTeam2021/data/chaosDaemons.ts on lines 34..54

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

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 tacticalPloys: Ploy[] = [
  {
    name: 'Warp Surge',
    cost: 1,
    description: `Use this Tactical Ploy when a friendly CHAOS DAEMON💀 operative is selected as the target of a ranged attack. Until the end of the Turning Point, each time a shooting attack is
Severity: Major
Found in src/components/KillTeam2021/data/chaosDaemons.ts and 1 other location - About 2 hrs to fix
src/components/KillTeam2021/data/kommando.ts on lines 34..50

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

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

                      <tr>
                        <th>A</th>
                        <th>WS</th>
                        <th>D</th>
                        <th>SR</th>
Severity: Major
Found in src/components/KillTeam2021/PowerList.tsx and 1 other location - About 2 hrs to fix
src/components/Intro.tsx on lines 13..19

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

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

      <ul>
        <li>All the info you need, when you need it</li>
        <li>Stats, abilities and stratagems organised by phase (40k and KT 2018)</li>
        <li>No wasted space for identical models</li>
        <li>Designed for print or screen</li>
Severity: Major
Found in src/components/Intro.tsx and 1 other location - About 2 hrs to fix
src/components/KillTeam2021/PowerList.tsx on lines 28..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 77.

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

export function StatsTable (props: Props): JSX.Element {
  return (
    <Table striped bordered size='sm'>
      <thead>
        <tr>
Severity: Minor
Found in src/components/WH40k9e/StatsTable.tsx - About 2 hrs to fix

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

    it('renders an image with a category class', () => {
      const component = TestRenderer.create(
        <CategoryIcon category='commander' />
      )
      expect(component.root.findByType('img').props.className).toBe('category')
    Severity: Major
    Found in src/components/KillTeam2018/CategoryIcon.test.tsx and 4 other locations - About 1 hr to fix
    src/components/KillTeam2018/CategoryIcon.test.tsx on lines 12..17
    src/components/KillTeam2018/CategoryIcon.test.tsx on lines 19..24
    src/components/KillTeam2018/SpecialistIcon.test.tsx on lines 5..10
    src/components/KillTeam2018/SpecialistIcon.test.tsx on lines 12..17

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

    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

    it('renders a image with a specialism class', () => {
      const component = TestRenderer.create(
        <SpecialistIcon specialism='combat' />
      )
      expect(component.root.findByType('img').props.className).toBe('specialism')
    Severity: Major
    Found in src/components/KillTeam2018/SpecialistIcon.test.tsx and 4 other locations - About 1 hr to fix
    src/components/KillTeam2018/CategoryIcon.test.tsx on lines 5..10
    src/components/KillTeam2018/CategoryIcon.test.tsx on lines 12..17
    src/components/KillTeam2018/CategoryIcon.test.tsx on lines 19..24
    src/components/KillTeam2018/SpecialistIcon.test.tsx on lines 12..17

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

    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

    it('renders the right image for combat specialism', () => {
      const component = TestRenderer.create(
        <SpecialistIcon specialism='combat' />
      )
      expect(component.root.findByType('img').props.src).toContain('combat.svg')
    Severity: Major
    Found in src/components/KillTeam2018/SpecialistIcon.test.tsx and 4 other locations - About 1 hr to fix
    src/components/KillTeam2018/CategoryIcon.test.tsx on lines 5..10
    src/components/KillTeam2018/CategoryIcon.test.tsx on lines 12..17
    src/components/KillTeam2018/CategoryIcon.test.tsx on lines 19..24
    src/components/KillTeam2018/SpecialistIcon.test.tsx on lines 5..10

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

    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

    it('renders the right image for leader category', () => {
      const component = TestRenderer.create(
        <CategoryIcon category='leader' />
      )
      expect(component.root.findByType('img').props.src).toContain('leader.svg')
    Severity: Major
    Found in src/components/KillTeam2018/CategoryIcon.test.tsx and 4 other locations - About 1 hr to fix
    src/components/KillTeam2018/CategoryIcon.test.tsx on lines 5..10
    src/components/KillTeam2018/CategoryIcon.test.tsx on lines 12..17
    src/components/KillTeam2018/SpecialistIcon.test.tsx on lines 5..10
    src/components/KillTeam2018/SpecialistIcon.test.tsx on lines 12..17

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

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

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

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

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

    Refactorings

    Further Reading

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

            {props.model.stats.invulnerable_save > 0
              ? <StatBadge name='Inv' value={`${props.model.stats.invulnerable_save}`} secondaryValue='+' />
              : <></>}
    Severity: Major
    Found in src/components/KillTeam2018/FightPhaseDetails.tsx and 1 other location - About 1 hr to fix
    src/components/KillTeam2018/ShootingPhaseDetails.tsx on lines 28..30

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

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

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

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

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

    Refactorings

    Further Reading

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

            {props.model.stats.invulnerable_save > 0
              ? <StatBadge name='Inv' value={`${props.model.stats.invulnerable_save}`} secondaryValue='+' />
              : <></>}
    Severity: Major
    Found in src/components/KillTeam2018/ShootingPhaseDetails.tsx and 1 other location - About 1 hr to fix
    src/components/KillTeam2018/FightPhaseDetails.tsx on lines 29..31

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 74.

    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

    it('renders the right image for commander category', () => {
      const component = TestRenderer.create(
        <CategoryIcon category='commander' />
      )
      expect(component.root.findByType('img').props.src).toContain('commander.svg')
    Severity: Major
    Found in src/components/KillTeam2018/CategoryIcon.test.tsx and 4 other locations - About 1 hr to fix
    src/components/KillTeam2018/CategoryIcon.test.tsx on lines 5..10
    src/components/KillTeam2018/CategoryIcon.test.tsx on lines 19..24
    src/components/KillTeam2018/SpecialistIcon.test.tsx on lines 5..10
    src/components/KillTeam2018/SpecialistIcon.test.tsx on lines 12..17

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

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

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

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

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

    Refactorings

    Further Reading

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

              <Row>
                <Col sm='12'>
                  <UnitTitle name={props.unit.name} uuid={props.unit.id} datasheet={props.unit.datasheet} />
                </Col>
              </Row>
    Severity: Major
    Found in src/components/WH40k9e/ChargePhaseDetails.tsx and 1 other location - About 1 hr to fix
    src/components/WH40k9e/BattleRoundStartPhaseDetails.tsx on lines 17..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 73.

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

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

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

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

    Refactorings

    Further Reading

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

              <Row style={{
                pageBreakInside: 'avoid'
              }}
              >
                <Col sm='12'>
    Severity: Major
    Found in src/components/WH40k9e/BattleRoundStartPhaseDetails.tsx and 1 other location - About 1 hr to fix
    src/components/WH40k9e/ChargePhaseDetails.tsx on lines 16..20

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

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

    export function Roster (props: Props): JSX.Element {
      const headingStyle = {
        background: '#FF6F2D',
        color: 'black',
        padding: '10px',
    Severity: Minor
    Found in src/components/KillTeam2021/Roster.tsx - About 1 hr to fix

      Function parseModel has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const parseModel = (model) => {
        const wargear = xpath(".//roster:profile[@typeName='Wargear']", model).map(parseWargear)
        const specialismSelection = xpath("roster:selections/roster:selection[roster:selections/roster:selection/roster:profiles/roster:profile/@typeName='Ability']", model)
        const abilities = xpath(".//roster:profile[@typeName='Ability']", model).map(parseAbility).concat(wargear)
        const stats = {
      Severity: Minor
      Found in src/parsers/KillTeam2018/BattlescribeParser.js - About 1 hr to fix

        Function Default has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const Default: FC<Props> = (props) => {
          const headingStyle = {
            background: '#FF6F2D',
            color: 'black',
            padding: '10px',
        Severity: Minor
        Found in src/components/KillTeam2021/FactionSpecificData/Default.tsx - About 1 hr to fix

          Function Datasheet has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function Datasheet (props: Props): JSX.Element {
            return (
              <Card className={props.datacard.operativeNames.length > 0 ? 'included' : 'excluded'}>
                <ModelTitle
                  name=''
          Severity: Minor
          Found in src/components/KillTeam2021/Datasheet.tsx - About 1 hr to fix
            Severity
            Category
            Status
            Source
            Language