jaroslavtyc/drd-plus-tables

View on GitHub

Showing 2,684 of 2,684 total issues

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

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

    protected function getExpectedDataHeaderNamesToTypes(): array
    {
        return [
            CombatActionCode::MOVE => self::BOOLEAN,
            CombatActionCode::RUN => self::BOOLEAN,
src/Combat/Actions/CombatActionsCompatibilityTable.php on lines 29..56

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

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

    protected function getExpectedDataHeaderNamesToTypes(): array
    {
        return [
            CombatActionCode::MOVE => self::BOOLEAN,
            CombatActionCode::RUN => self::BOOLEAN,
Severity: Major
Found in src/Combat/Actions/CombatActionsCompatibilityTable.php and 1 other location - About 1 day to fix
src/Combat/Actions/CombatActionsWithWeaponTypeCompatibilityTable.php on lines 28..55

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

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

Demon has 58 functions (exceeds 20 allowed). Consider refactoring.
Open

class Demon extends StrictObject
{
    use SanitizeMutableParameterChangesTrait;

    private \DrdPlus\Codes\Theurgist\DemonCode $demonCode;
Severity: Major
Found in src/Theurgist/Demons/Demon.php - About 1 day to fix

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

        public function I_can_not_affect_formula_spell_power_by_thunder_modifier(): void
        {
            $formulaCode = FormulaCode::getIt(FormulaCode::GREAT_MASSACRE);
            $formulasTable = $this->createFormulasTable();
            /** like instance of @see SpellPower */
    Severity: Major
    Found in tests/Tables/Theurgist/Spells/FormulaTest.php and 1 other location - About 7 hrs to fix
    tests/Tables/Theurgist/Spells/FormulaTest.php on lines 260..288

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

    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_not_affect_formula_parameter_by_modifier_without_that_parameter_affection(): void
        {
            $formulaCode = FormulaCode::getIt(FormulaCode::GREAT_MASSACRE);
            $formulasTable = $this->createFormulasTable();
            /** like instance of @see SpellPower */
    Severity: Major
    Found in tests/Tables/Theurgist/Spells/FormulaTest.php and 1 other location - About 7 hrs to fix
    tests/Tables/Theurgist/Spells/FormulaTest.php on lines 227..255

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

    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

    FormulaTest has 54 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class FormulaTest extends TestWithMockery
    {
        private static ?string $parameterNamespace = null;
    
        /**
    Severity: Major
    Found in tests/Tables/Theurgist/Spells/FormulaTest.php - About 7 hrs to fix

      RacesTableTest has 53 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class RacesTableTest extends TableTest
      {
      
          /**
           * @test
      Severity: Major
      Found in tests/Tables/Races/RacesTableTest.php - About 7 hrs to fix

        Modifier has 51 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Modifier extends StrictObject
        {
            use ToFlatArrayTrait;
            use SanitizeMutableParameterChangesTrait;
        
        
        Severity: Major
        Found in src/Theurgist/Spells/Modifier.php - About 7 hrs to fix

          File Formula.php has 459 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php declare(strict_types = 1);
          
          namespace DrdPlus\Tables\Theurgist\Spells;
          
          use DrdPlus\Codes\Units\DistanceUnitCode;
          Severity: Minor
          Found in src/Theurgist/Spells/Formula.php - About 7 hrs to fix

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

                    return [
                        ProfessionCode::COMMONER => [self::FIRST_PROPERTY => false, self::SECOND_PROPERTY => PropertyCode::AGILITY],
                        ProfessionCode::FIGHTER => [self::FIRST_PROPERTY => PropertyCode::AGILITY, self::SECOND_PROPERTY => false],
                        ProfessionCode::THIEF => [self::FIRST_PROPERTY => PropertyCode::KNACK, self::SECOND_PROPERTY => PropertyCode::AGILITY],
                        ProfessionCode::RANGER => [self::FIRST_PROPERTY => PropertyCode::KNACK, self::SECOND_PROPERTY => PropertyCode::AGILITY],
            Severity: Major
            Found in src/Combat/FightTable.php and 1 other location - About 6 hrs to fix
            tests/Tables/Combat/FightTableTest.php on lines 26..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 219.

            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

                        [
                            ProfessionCode::COMMONER => [FightTable::FIRST_PROPERTY => false, FightTable::SECOND_PROPERTY => PropertyCode::AGILITY],
                            ProfessionCode::FIGHTER => [FightTable::FIRST_PROPERTY => PropertyCode::AGILITY, FightTable::SECOND_PROPERTY => false],
                            ProfessionCode::THIEF => [FightTable::FIRST_PROPERTY => PropertyCode::KNACK, FightTable::SECOND_PROPERTY => PropertyCode::AGILITY],
                            ProfessionCode::RANGER => [FightTable::FIRST_PROPERTY => PropertyCode::KNACK, FightTable::SECOND_PROPERTY => PropertyCode::AGILITY],
            Severity: Major
            Found in tests/Tables/Combat/FightTableTest.php and 1 other location - About 6 hrs to fix
            src/Combat/FightTable.php on lines 37..45

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

            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

            Formula has 46 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Formula extends StrictObject
            {
                use ToFlatArrayTrait;
                use SanitizeMutableParameterChangesTrait;
            
            
            Severity: Minor
            Found in src/Theurgist/Spells/Formula.php - About 6 hrs to fix

              RacesTable has 46 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class RacesTable extends AbstractFileTable
              {
                  private \DrdPlus\Tables\Races\FemaleModifiersTable $femaleModifiersTable;
              
                  public function __construct(FemaleModifiersTable $femaleModifiersTable)
              Severity: Minor
              Found in src/Races/RacesTable.php - About 6 hrs to fix

                File Demon.php has 416 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php declare(strict_types=1);
                
                namespace DrdPlus\Tables\Theurgist\Demons;
                
                use DrdPlus\Codes\Theurgist\DemonBodyCode;
                Severity: Minor
                Found in src/Theurgist/Demons/Demon.php - About 6 hrs to fix

                  File ModifiersTableTest.php has 413 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php declare(strict_types = 1);
                  
                  namespace DrdPlus\Tests\Tables\Theurgist\Spells;
                  
                  use DrdPlus\Codes\Theurgist\FormCode;
                  Severity: Minor
                  Found in tests/Tables/Theurgist/Spells/ModifiersTableTest.php - About 5 hrs to fix

                    Method I_can_get_expected_values has 147 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function I_can_get_expected_values(): void
                        {
                            $racesTable = new RacesTable(Tables::getIt()->getFemaleModifiersTable());
                            self::assertEquals(
                                [
                    Severity: Major
                    Found in tests/Tables/Races/RacesTableTest.php - About 5 hrs to fix

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

                          public function I_can_get_wild_kroll_modifiers(): void
                          {
                              $racesTable = new RacesTable(Tables::getIt()->getFemaleModifiersTable());
                              $modifiers = $racesTable->getWildKrollModifiers();
                              self::assertEquals(
                      Severity: Major
                      Found in tests/Tables/Races/RacesTableTest.php and 1 other location - About 5 hrs to fix
                      tests/Tables/Races/RacesTableTest.php on lines 359..384

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

                      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 I_can_get_mountain_dwarf_modifiers(): void
                          {
                              $racesTable = new RacesTable(Tables::getIt()->getFemaleModifiersTable());
                              $modifiers = $racesTable->getMountainDwarfModifiers();
                              self::assertEquals(
                      Severity: Major
                      Found in tests/Tables/Races/RacesTableTest.php and 2 other locations - About 5 hrs to fix
                      tests/Tables/Races/RacesTableTest.php on lines 139..164
                      tests/Tables/Races/RacesTableTest.php on lines 179..204

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

                      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_green_elf_modifiers(): void
                          {
                              $racesTable = new RacesTable(Tables::getIt()->getFemaleModifiersTable());
                              $modifiers = $racesTable->getGreenElfModifiers();
                              self::assertEquals(
                      Severity: Major
                      Found in tests/Tables/Races/RacesTableTest.php and 1 other location - About 5 hrs to fix
                      tests/Tables/Races/RacesTableTest.php on lines 239..264

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

                      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