src/commands/CrudController.php
File CrudController.php
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace luya\admin\commands;
use luya\admin\base\BaseCrudController;
CrudController
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class CrudController extends BaseCrudController
{
/**
* @var boolean Whether the core modules should be hidden from selection list or not.
*/
Method actionCreate
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function actionCreate()
{
// 1. ask for module
if ($this->moduleName === null) {
Console::clearScreenBeforeCursor();
Function generateModelContent
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
public function generateModelContent($fileNamepsace, $className, $apiEndpoint, TableSchema $schema, $i18nFields)
{
$alias = Inflector::humanize(Inflector::camel2words($className));
$dbTableName = $schema->fullName;
- 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 actionCreate
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
public function actionCreate()
{
// 1. ask for module
if ($this->moduleName === null) {
Console::clearScreenBeforeCursor();
- 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 generateModelContent
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function generateModelContent($fileNamepsace, $className, $apiEndpoint, TableSchema $schema, $i18nFields)
{
$alias = Inflector::humanize(Inflector::camel2words($className));
$dbTableName = $schema->fullName;
Method generateModelContent
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function generateModelContent($fileNamepsace, $className, $apiEndpoint, TableSchema $schema, $i18nFields)