Showing 9 of 18 total issues
Method createClass
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createClass(string $className, string $table, string $namespace, bool $multiline = false): string
{
if ($multiline) {
return <<<EOT
<?php
Method actionIndex
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionIndex(): void
{
Cli::printer("Enter table name: ", "magneta");
$table = str_replace(PHP_EOL, "", Cli::reader());
Function renderLinks
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function renderLinks(array $links, string $page, $pg_limit, $uri)
{
$last = array_key_last($links) + 1;
?>
<!-- FIRST -->
- 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 createClass
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createClass(string $controllerPrefix, string $container): string
{
$url = strtolower("$container/$controllerPrefix");
if (Rudra::config()->get("attributes")) {
Function actionIndex
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function actionIndex(): void
{
Cli::printer("Enter table name: ", "magneta");
$table = str_replace(PHP_EOL, "", Cli::reader());
- 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 actionIndex
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function actionIndex(): void
{
Cli::printer("Enter container (empty for Ship): ", "magneta");
$container = ucfirst(str_replace(PHP_EOL, "", Cli::reader()));
- 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 actionIndex
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionIndex(): void
{
Cli::printer("Enter container name: ", "magneta");
$container = ucfirst(str_replace(PHP_EOL, "", Cli::reader()));
$className = $container . 'Controller';
Function actionIndex
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function actionIndex(): void
{
Cli::printer("Enter container (empty for Ship): ", "magneta");
$container = ucfirst(str_replace(PHP_EOL, "", Cli::reader()));
- 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 handle404
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function handle404($data, string $type = 'db', array $page = []): void
{
if ($type == 'db') {
if (count($data) < 1 || !$data) {
throw new RouterException('404');
- 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"