GrafiteInc/CrudMaker

View on GitHub

Showing 23 of 25 total issues

Method handle has 88 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function handle()
    {
        $section = '';
        $splitTable = [];

Severity: Major
Found in src/Console/CrudMaker.php - About 3 hrs to fix

    Function createSchema has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

        public function createSchema($config, $section, $table, $splitTable, $schema)
        {
            $migrationFiles = $this->filesystem->allFiles($this->getMigrationsPath($config));
    
            if (!empty($section)) {
    Severity: Minor
    Found in src/Generators/DatabaseGenerator.php - About 2 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

    Method configASectionedCRUD has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function configASectionedCRUD($config, $section, $table, $splitTable)
        {
            $appPath = app()->path();
            $basePath = app()->basePath();
            $appNamespace = $this->appService->getAppNamespace();
    Severity: Major
    Found in src/Services/ConfigService.php - About 2 hrs to fix

      Method basicConfig has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function basicConfig($framework, $appPath, $basePath, $appNamespace, $table, $options)
          {
              $config = [
                  'framework'                  => $framework,
                  'bootstrap'                  => false,
      Severity: Major
      Found in src/Services/ConfigService.php - About 2 hrs to fix

        Method createSchema has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function createSchema($config, $section, $table, $splitTable, $schema)
            {
                $migrationFiles = $this->filesystem->allFiles($this->getMigrationsPath($config));
        
                if (!empty($section)) {
        Severity: Minor
        Found in src/Generators/DatabaseGenerator.php - About 1 hr to fix

          Method handle has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function handle()
              {
                  $filesystem = new Filesystem();
                  $tableService = new TableService();
                  $table = (string) $this->argument('table');
          Severity: Minor
          Found in src/Console/TableCrudMaker.php - About 1 hr to fix

            Function crudReport has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                private function crudReport($table)
                {
                    $this->line("\n");
                    $this->line('Built model...');
                    $this->line('Built request...');
            Severity: Minor
            Found in src/Console/CrudMaker.php - About 1 hr 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

            Function handle has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                public function handle()
                {
                    $section = '';
                    $splitTable = [];
            
            
            Severity: Minor
            Found in src/Console/CrudMaker.php - About 1 hr 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

            Method createExampleByType has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function createExampleByType($type)
                {
                    $faker = Faker::create();
            
                    $typeArray = [
            Severity: Minor
            Found in src/Services/TableService.php - About 1 hr to fix

              Method crudReport has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function crudReport($table)
                  {
                      $this->line("\n");
                      $this->line('Built model...');
                      $this->line('Built request...');
              Severity: Minor
              Found in src/Console/CrudMaker.php - About 1 hr to fix

                Function validateSchema has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function validateSchema($command)
                    {
                        if ($command->option('schema')) {
                            $definitions = $this->calibrateDefinitions($command->option('schema'));
                
                
                Severity: Minor
                Found in src/Services/ValidatorService.php - About 55 mins 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

                Function createColumnDetailString has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function createColumnDetailString($columnDetails)
                    {
                        $columnDetailString = '';
                
                        if (count($columnDetails) > 1) {
                Severity: Minor
                Found in src/Generators/DatabaseGenerator.php - About 55 mins 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

                Method basicConfig has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public function basicConfig($framework, $appPath, $basePath, $appNamespace, $table, $options)
                Severity: Minor
                Found in src/Services/ConfigService.php - About 45 mins to fix

                  Method generateDB has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function generateDB($config, $bar, $section, $table, $splitTable, $command)
                  Severity: Minor
                  Found in src/Services/CrudService.php - About 45 mins to fix

                    Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            AppService $appService,
                            CrudService $crudService,
                            CrudGenerator $crudGenerator,
                            ConfigService $configService,
                            ValidatorService $validator
                    Severity: Minor
                    Found in src/Console/CrudMaker.php - About 35 mins to fix

                      Method createMigration has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public function createMigration($config, $section, $table, $splitTable, $command)
                      Severity: Minor
                      Found in src/Generators/DatabaseGenerator.php - About 35 mins to fix

                        Method createSchema has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            public function createSchema($config, $section, $table, $splitTable, $schema)
                        Severity: Minor
                        Found in src/Generators/DatabaseGenerator.php - About 35 mins to fix

                          Function getApiTestTemplates has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function getApiTestTemplates($templates, $apiOnly, $withApi)
                              {
                                  $filteredTemplates = [];
                          
                                  foreach ($templates as $template) {
                          Severity: Minor
                          Found in src/Services/TestService.php - About 35 mins 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

                          Function getRegularTestTemplates has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function getRegularTestTemplates($templates, $apiOnly)
                              {
                                  $filteredTemplates = [];
                          
                                  foreach ($templates as $template) {
                          Severity: Minor
                          Found in src/Services/TestService.php - About 35 mins 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

                          Function handle has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function handle()
                              {
                                  $filesystem = new Filesystem();
                                  $tableService = new TableService();
                                  $table = (string) $this->argument('table');
                          Severity: Minor
                          Found in src/Console/TableCrudMaker.php - About 35 mins 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