alecgunnar/Maverick

View on GitHub

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;

    /*
Severity: Minor
Found in src/bootstrap.php - About 55 mins to fix

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
Severity: Minor
Found in src/Console/Command/Build/Step/BuildStep.php - About 35 mins to fix

    Function rmdir has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function rmdir(string $directory) {
            if (!is_dir($directory)) {
                return;
            }
    
    
    Severity: Minor
    Found in src/Console/Command/Build/Step/InvalidateCacheBuildStep.php - About 25 mins to fix

    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);
    Severity: Minor
    Found in src/Application.php - About 25 mins to fix

    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">
    Severity: Minor
    Found in src/View/DefaultView.php by phpcodesniffer

    Line exceeds 120 characters; contains 138 characters
    Open

                $header = sprintf('HTTP/%s %s %s', $response->getProtocolVersion(), $response->getStatusCode(), $response->getReasonPhrase());
    Severity: Minor
    Found in src/Application.php by phpcodesniffer

    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">
    Severity: Minor
    Found in src/View/DefaultView.php by phpcodesniffer

    Line exceeds 120 characters; contains 143 characters
    Open

        protected function addOption(string $name, string $shortcut = null, int $mode = null, string $description = '', $default = null): BuildStep

    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');

    Line exceeds 120 characters; contains 125 characters
    Open

            $this->addOption('environment', 'env', InputOption::VALUE_REQUIRED, 'What environment would you like to build for?');

    Line exceeds 120 characters; contains 131 characters
    Open

        public function __construct(RouterInterface $router, ContainerInterface $container, ErrorHandlerInterface $errorHandler = null)
    Severity: Minor
    Found in src/Application.php by phpcodesniffer

    Expected 1 space after IF keyword; 0 found
    Open

            if(!is_dir($public)) {

    Opening brace should be on a new line
    Open

        protected function rmdir(string $directory) {

    Whitespace found at end of line
    Open

        /** 

    Expected 1 space after IF keyword; 0 found
    Open

            if(!file_exists($source)) {

    Expected 1 space after IF keyword; 0 found
    Open

            if(!file_exists($source)) {
    Severity
    Category
    Status
    Source
    Language