deployphp/deployer

View on GitHub

Showing 143 of 189 total issues

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

                        Avoid too many return statements within this method.
                        Open

                                    return 'bash -ls';
                        Severity: Major
                        Found in src/Deployer.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return "$colors[14]$alias\x1b[0m";
                          Severity: Major
                          Found in src/Support/helpers.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                    return self::EQUAL_TO;
                            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 Master(
                                              $c['hosts'],
                                              $c['input'],
                                              $c['output'],
                                              $c['messenger'],
                              Severity: Major
                              Found in src/Deployer.php - About 30 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language