jaroslavtyc/drd-plus-tables

View on GitHub

Showing 213 of 2,684 total issues

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

        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

          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

            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

              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

                      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

                                DemonTest has 41 functions (exceeds 20 allowed). Consider refactoring.
                                Open

                                class DemonTest extends TestWithMockery
                                {
                                    private static ?string $demonParameterNamespace = null;
                                    private static ?string $spellParameterNamespace = null;
                                
                                
                                Severity: Minor
                                Found in tests/Tables/Theurgist/Demons/DemonTest.php - About 5 hrs to fix

                                  Method I_can_get_all_values has 125 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function I_can_get_all_values()
                                      {
                                          self::assertSame(
                                              [
                                                  0 => [

                                    File ModifierTest.php has 365 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

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

                                      File Modifier.php has 363 lines of code (exceeds 250 allowed). Consider refactoring.
                                      Open

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

                                        Function I_can_get_parent_modifiers has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            public function I_can_get_parent_modifiers()
                                            {
                                                $modifiersTable = new ModifiersTable(Tables::getIt());
                                                $fromParentMatchingProfiles = [];
                                                foreach (ModifierCode::getPossibleValues() as $modifierValue) {
                                        Severity: Minor
                                        Found in tests/Tables/Theurgist/Spells/ModifiersTableTest.php - About 4 hrs to fix

                                        Cognitive Complexity

                                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                        A method's cognitive complexity is based on a few simple rules:

                                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                        • Code is considered more complex for each "break in the linear flow of the code"
                                        • Code is considered more complex when "flow breaking structures are nested"

                                        Further reading

                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language