Showing 23 of 25 total issues
Method handle
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle()
{
$section = '';
$splitTable = [];
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)) {
- Read upRead up
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();
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,
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)) {
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');
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...');
- Read upRead up
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 = [];
- Read upRead up
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 = [
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...');
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'));
- Read upRead up
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) {
- Read upRead up
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)
Method generateDB
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function generateDB($config, $bar, $section, $table, $splitTable, $command)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
AppService $appService,
CrudService $crudService,
CrudGenerator $crudGenerator,
ConfigService $configService,
ValidatorService $validator
Method createMigration
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function createMigration($config, $section, $table, $splitTable, $command)
Method createSchema
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function createSchema($config, $section, $table, $splitTable, $schema)
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) {
- Read upRead up
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) {
- Read upRead up
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');
- Read upRead up
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"