deployphp/deployer

View on GitHub

Showing 189 of 189 total issues

Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        Host $host,
        string $command,
        int $exitCode,
        string $output,
        string $errorOutput,
Severity: Minor
Found in src/Exception/RunException.php - About 35 mins to fix

    Method option has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function option(string $name, $shortcut = null, ?int $mode = null, string $description = '', $default = null): void
    Severity: Minor
    Found in src/functions.php - About 35 mins to fix

      Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              int $major = 0,
              int $minor = 0,
              int $patch = 0,
              array $pre = [],
              array $build = [],
      Severity: Minor
      Found in src/Component/PharUpdate/Version/Version.php - About 35 mins to fix

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

        function host(string ...$hostname)
        {
            $deployer = Deployer::get();
            if (count($hostname) === 1 && $deployer->hosts->has($hostname[0])) {
                return $deployer->hosts->get($hostname[0]);
        Severity: Minor
        Found in src/functions.php - About 35 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 send has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function send(?array &$info = null): string
            {
                if ($this->url === '') {
                    throw new \RuntimeException('URL must not be empty to Httpie::send()');
                }
        Severity: Minor
        Found in src/Utility/Httpie.php - About 35 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 commit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function commit(array $hosts, Task $task): void
            {
                $row = [];
                foreach ($this->template as $alias) {
                    $on = "-";
        Severity: Minor
        Found in src/Executor/Planner.php - About 35 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 parseRequest has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            private function parseRequest($request)
            {
                $lines = explode("\r\n", $request);
                $requestLine = $lines[0];
                $parts = explode(' ', $requestLine);
        Severity: Minor
        Found in src/Executor/Server.php - About 35 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 expand has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function expand(array $hostnames): array
            {
                $expanded = [];
                foreach ($hostnames as $hostname) {
                    if (preg_match(self::PATTERN, $hostname, $matches)) {
        Severity: Minor
        Found in src/Host/Range.php - About 35 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 extend has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function extend(string $id, callable $callable)
            {
                if (!isset($this->keys[$id])) {
                    throw new UnknownIdentifierException($id);
                }
        Severity: Minor
        Found in src/Component/Pimple/Container.php - About 35 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

        Avoid too many return statements within this method.
        Open

                        return self::GREATER_THAN;
        Severity: Major
        Found in src/Component/PharUpdate/Version/Comparator.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return $this->parse($default);
          Severity: Major
          Found in src/Configuration.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return new Messenger($c['input'], $c['output'], $c['logger']);
            Severity: Major
            Found in src/Deployer.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return $this->cumulativeExitCode($processes);
              Severity: Major
              Found in src/Executor/Master.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return 'bash -s'; // Non-login shell for localhost.
                Severity: Major
                Found in src/Deployer.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return new Importer();
                  Severity: Major
                  Found in src/Deployer.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                    return $x;
                    Severity: Major
                    Found in src/Component/PharUpdate/Version/Comparator.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return new Collection();
                      Severity: Major
                      Found in src/Deployer.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return $x;
                        Severity: Major
                        Found in src/Component/PharUpdate/Version/Comparator.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                              return new Response(404, null);
                          Severity: Major
                          Found in src/Executor/Master.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                        return new ProcessRunner($c['pop'], $c['logger']);
                            Severity: Major
                            Found in src/Deployer.php - About 30 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language