jaroslavtyc/drd-plus-tables

View on GitHub

Showing 2,684 of 2,684 total issues

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

<?php declare(strict_types = 1);

namespace DrdPlus\Tests\Tables\Armaments\Weapons\Melee;

use DrdPlus\Codes\Armaments\MeleeWeaponCode;
tests/Tables/Armaments/Weapons/Melee/MorningstarsAndMorgensternsTableTest.php on lines 1..93
tests/Tables/Armaments/Weapons/Melee/SwordsTableTest.php on lines 1..94

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

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

<?php declare(strict_types = 1);

namespace DrdPlus\Tests\Tables\Armaments\Weapons\Melee;

use DrdPlus\Codes\Armaments\MeleeWeaponCode;
Severity: Major
Found in tests/Tables/Armaments/Weapons/Melee/SwordsTableTest.php and 2 other locations - About 6 days to fix
tests/Tables/Armaments/Weapons/Melee/MorningstarsAndMorgensternsTableTest.php on lines 1..93
tests/Tables/Armaments/Weapons/Melee/VoulgesAndTridentsTableTest.php on lines 1..93

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

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

<?php declare(strict_types = 1);

namespace DrdPlus\Tests\Tables\Armaments\Weapons\Melee;

use DrdPlus\Codes\Armaments\MeleeWeaponCode;
tests/Tables/Armaments/Weapons/Melee/SwordsTableTest.php on lines 1..94
tests/Tables/Armaments/Weapons/Melee/VoulgesAndTridentsTableTest.php on lines 1..93

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

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

File RacesTableTest.php has 1028 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php declare(strict_types = 1);

namespace DrdPlus\Tests\Tables\Races;

use DrdPlus\Codes\GenderCode;
Severity: Major
Found in tests/Tables/Races/RacesTableTest.php - About 2 days to fix

    File Tables.php has 937 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php declare(strict_types=1);
    
    namespace DrdPlus\Tables;
    
    use DrdPlus\Codes\Armaments\ArmamentCode;
    Severity: Major
    Found in src/Tables.php - About 2 days to fix

      File FormulaTest.php has 802 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php declare(strict_types=1);
      
      namespace DrdPlus\Tests\Tables\Theurgist\Spells;
      
      use DrdPlus\Codes\Theurgist\AffectionPeriodCode;
      Severity: Major
      Found in tests/Tables/Theurgist/Spells/FormulaTest.php - About 1 day to fix

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

            public function provideDemonAndExpectedKind(): array
            {
                return [
                    DemonCode::CRON => [DemonCode::CRON, DemonKindCode::BARE],
                    DemonCode::DEMON_OF_MOVEMENT => [DemonCode::DEMON_OF_MOVEMENT, DemonKindCode::ANIMATING],
        Severity: Major
        Found in tests/Tables/Theurgist/Demons/DemonsTableTest.php and 1 other location - About 1 day to fix
        tests/Tables/Theurgist/Demons/DemonsTableTest.php on lines 109..131

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

        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

            public function provideDemonAndExpectedBody(): array
            {
                return [
                    DemonCode::CRON => [DemonCode::CRON, DemonBodyCode::CLOCK],
                    DemonCode::DEMON_OF_MOVEMENT => [DemonCode::DEMON_OF_MOVEMENT, DemonBodyCode::PEBBLE],
        Severity: Major
        Found in tests/Tables/Theurgist/Demons/DemonsTableTest.php and 1 other location - About 1 day to fix
        tests/Tables/Theurgist/Demons/DemonsTableTest.php on lines 148..170

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

        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

        Tables has 96 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Tables extends StrictObject implements \IteratorAggregate
        {
            private static ?Tables $tablesInstance = null;
        
            public static function getIt(): Tables
        Severity: Major
        Found in src/Tables.php - About 1 day to fix

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

              public function I_can_get_child_modifiers()
              {
                  $modifiersTable = new ModifiersTable(Tables::getIt());
                  $fromChildrenMatchingProfiles = [];
                  foreach (ModifierCode::getPossibleValues() as $modifierValue) {
          Severity: Major
          Found in tests/Tables/Theurgist/Spells/ModifiersTableTest.php and 1 other location - About 1 day to fix
          tests/Tables/Theurgist/Spells/ModifiersTableTest.php on lines 380..431

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

          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

              public function I_can_get_parent_modifiers()
              {
                  $modifiersTable = new ModifiersTable(Tables::getIt());
                  $fromParentMatchingProfiles = [];
                  foreach (ModifierCode::getPossibleValues() as $modifierValue) {
          Severity: Major
          Found in tests/Tables/Theurgist/Spells/ModifiersTableTest.php and 1 other location - About 1 day to fix
          tests/Tables/Theurgist/Spells/ModifiersTableTest.php on lines 436..487

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

          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

              public function provideInfravisionOfRace(): array
              {
                  return [
                      [RaceCode::HUMAN, SubRaceCode::COMMON, false],
                      [RaceCode::HUMAN, SubRaceCode::HIGHLANDER, false],
          Severity: Major
          Found in tests/Tables/Races/RacesTableTest.php and 2 other locations - About 1 day to fix
          tests/Tables/Races/RacesTableTest.php on lines 1186..1204
          tests/Tables/Races/RacesTableTest.php on lines 1219..1237

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

          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

              public function provideRequirementOfDmForRace(): array
              {
                  return [
                      [RaceCode::HUMAN, SubRaceCode::COMMON, false],
                      [RaceCode::HUMAN, SubRaceCode::HIGHLANDER, false],
          Severity: Major
          Found in tests/Tables/Races/RacesTableTest.php and 2 other locations - About 1 day to fix
          tests/Tables/Races/RacesTableTest.php on lines 1153..1171
          tests/Tables/Races/RacesTableTest.php on lines 1186..1204

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

          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

                  foreach (DemonCode::getPossibleValues() as $demonValue) {
                      $demonCode = DemonCode::getIt($demonValue);
                      $demonsTable = $this->createDemonsTable();
                      $baseParameters = [];
                      foreach (DemonMutableParameterCode::getPossibleValues() as $mutableParameterName) {
          Severity: Major
          Found in tests/Tables/Theurgist/Demons/DemonTest.php and 1 other location - About 1 day to fix
          tests/Tables/Theurgist/Spells/FormulaTest.php on lines 322..352

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

          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

                  foreach (FormulaCode::getPossibleValues() as $formulaValue) {
                      $formulaCode = FormulaCode::getIt($formulaValue);
                      $formulasTable = $this->createFormulasTable();
                      $baseParameters = [];
                      foreach (FormulaMutableParameterCode::getPossibleValues() as $mutableParameterName) {
          Severity: Major
          Found in tests/Tables/Theurgist/Spells/FormulaTest.php and 1 other location - About 1 day to fix
          tests/Tables/Theurgist/Demons/DemonTest.php on lines 265..295

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

          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

              public function provideNativeRegenerationOfRace(): array
              {
                  return [
                      [RaceCode::HUMAN, SubRaceCode::COMMON, false],
                      [RaceCode::HUMAN, SubRaceCode::HIGHLANDER, false],
          Severity: Major
          Found in tests/Tables/Races/RacesTableTest.php and 2 other locations - About 1 day to fix
          tests/Tables/Races/RacesTableTest.php on lines 1153..1171
          tests/Tables/Races/RacesTableTest.php on lines 1219..1237

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

          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

              public function provideFateAndExpectedSecondaryProperty()
              {
                  return [
                      [FateCode::EXCEPTIONAL_PROPERTIES, 1, 0],
                      [FateCode::EXCEPTIONAL_PROPERTIES, 2, 1],
          Severity: Major
          Found in tests/Tables/History/InfluenceOfFortuneTableTest.php and 1 other location - About 1 day to fix
          tests/Tables/History/InfluenceOfFortuneTableTest.php on lines 44..66

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

          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

              public function provideFateAndExpectedPrimaryProperty()
              {
                  return [
                      [FateCode::EXCEPTIONAL_PROPERTIES, 1, 1],
                      [FateCode::EXCEPTIONAL_PROPERTIES, 2, 1],
          Severity: Major
          Found in tests/Tables/History/InfluenceOfFortuneTableTest.php and 1 other location - About 1 day to fix
          tests/Tables/History/InfluenceOfFortuneTableTest.php on lines 93..115

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

          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

          File DemonTest.php has 588 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php declare(strict_types=1);
          
          namespace DrdPlus\Tests\Tables\Theurgist\Demons;
          
          use DrdPlus\Codes\Theurgist\AffectionPeriodCode;
          Severity: Major
          Found in tests/Tables/Theurgist/Demons/DemonTest.php - About 1 day to fix

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

                private function getValueInDifferentUnit(string $toUnit): float
                {
                    if ($this->getUnit() === $toUnit) {
                        return $this->getValue();
                    }
            Severity: Major
            Found in src/Measurements/Volume/Volume.php and 1 other location - About 1 day to fix
            src/Measurements/Square/Square.php on lines 89..124

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

            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