Showing 16 of 16 total issues
Function bootstrap
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function bootstrap(string $root, bool $debug = false, bool $enable = true): ContainerInterface
{
$container = null;
/*
- 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 addOption
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function addOption(string $name, string $shortcut = null, int $mode = null, string $description = '', $default = null): BuildStep
Function rmdir
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function rmdir(string $directory) {
if (!is_dir($directory)) {
return;
}
- 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 sendResponse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function sendResponse(ResponseInterface $response): void
{
if (!headers_sent()) {
$header = sprintf('HTTP/%s %s %s', $response->getProtocolVersion(), $response->getStatusCode(), $response->getReasonPhrase());
header($header);
- 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
Line exceeds 120 characters; contains 222 characters Open
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
- Exclude checks
Line exceeds 120 characters; contains 138 characters Open
$header = sprintf('HTTP/%s %s %s', $response->getProtocolVersion(), $response->getStatusCode(), $response->getReasonPhrase());
- Exclude checks
Line exceeds 120 characters; contains 216 characters Open
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
- Exclude checks
Line exceeds 120 characters; contains 143 characters Open
protected function addOption(string $name, string $shortcut = null, int $mode = null, string $description = '', $default = null): BuildStep
- Exclude checks
Line exceeds 120 characters; contains 130 characters Open
$message = sprintf('The service "%s" could not be retrieved from the container. Reason: %s', $name, $reason ?? 'Unknown');
- Exclude checks
Line exceeds 120 characters; contains 125 characters Open
$this->addOption('environment', 'env', InputOption::VALUE_REQUIRED, 'What environment would you like to build for?');
- Exclude checks
Line exceeds 120 characters; contains 131 characters Open
public function __construct(RouterInterface $router, ContainerInterface $container, ErrorHandlerInterface $errorHandler = null)
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
if(!is_dir($public)) {
- Exclude checks
Opening brace should be on a new line Open
protected function rmdir(string $directory) {
- Exclude checks
Whitespace found at end of line Open
/**
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
if(!file_exists($source)) {
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
if(!file_exists($source)) {
- Exclude checks