fucongcong/framework

View on GitHub
core/Group/Console/Command/GenerateControllerCommand.php

Summary

Maintainability
A
2 hrs
Test Coverage

Showing 8 of 8 total issues

Method init has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

public function init()
{
$input = $this->getArgv();
 
if (!isset($input[0])) {
Severity: Minor
Found in core/Group/Console/Command/GenerateControllerCommand.php - About 1 hr to fix

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

    public function init()
    {
    $input = $this->getArgv();
     
    if (!isset($input[0])) {
    Severity: Minor
    Found in core/Group/Console/Command/GenerateControllerCommand.php - About 35 mins to fix

    The method init uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

    } else {
    $group = 'Web';
    $name = $input[0];
    }

    Blank line found at start of control structure
    Open

    if (is_dir($dir."/Controller/".$controllerName)) {

    Space before opening parenthesis of function call prohibited
    Open

    file_put_contents ($dir."/Views/".$controllerName."/"."index.html.twig", $data);

    Space before opening parenthesis of function call prohibited
    Open

    file_put_contents ($dir."/Controller/".$controllerName."/".$controllerName."Controller.php", $data);

    Space before opening parenthesis of function call prohibited
    Open

    file_put_contents ($dir."/routing.php", $data);

    Whitespace found at end of line
    Open

    {

    There are no issues that match your filters.

    Category
    Status