REBELinBLUE/deployer

View on GitHub

Showing 76 of 2,695 total issues

Avoid too many return statements within this function.
Open

  return 0;
Severity: Major
Found in resources/assets/src/views/Audit.js - About 30 mins to fix

Avoid too many return statements within this method.
Open

        return 'question-circle';
Severity: Major
Found in app/View/Presenters/ProjectPresenter.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

        return $this->translator->trans('commands.clone');
Severity: Major
Found in app/View/Presenters/DeployStepPresenter.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

        return 'fa-git-square';
Severity: Major
Found in app/View/Presenters/ProjectPresenter.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

        return $this->translator->trans('projects.not_deployed');
Severity: Major
Found in app/View/Presenters/ProjectPresenter.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

            return $this->translator->trans('deployments.deploying');
Severity: Major
Found in app/View/Presenters/DeploymentPresenter.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

        return $this->translator->trans('deployments.pending');
Severity: Major
Found in app/View/Presenters/DeploymentPresenter.php - About 30 mins to fix

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

    private function runDeploymentStepOnServer(ServerLog $log)
    {
        $process = $this->builder->buildScript($log->server);

        if (!empty($process)) {
Severity: Minor
Found in app/Jobs/DeployProject/RunDeploymentStep.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 presentReadableStatus has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function presentReadableStatus()
    {
        if ($this->status === Deployment::COMPLETED) {
            return $this->translator->trans('deployments.completed');
        } elseif ($this->status === Deployment::COMPLETED_WITH_ERRORS) {
Severity: Minor
Found in app/View/Presenters/DeploymentPresenter.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 presentTypeIcon has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function presentTypeIcon()
    {
        $details = $this->accessDetails();

        if (isset($details['domain'])) {
Severity: Minor
Found in app/View/Presenters/ProjectPresenter.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 heartbeatsStatus has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function heartbeatsStatus()
    {
        if (empty($this->heartbeatStatus)) {
            $length = count($this->heartbeats);
            $missed = 0;
Severity: Minor
Found in app/Project.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 applicationCheckUrlStatus has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function applicationCheckUrlStatus()
    {
        if (empty($this->checkurlStatus)) {
            $length = count($this->checkUrls);
            $missed = 0;
Severity: Minor
Found in app/Project.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 fail has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function fail(Exception $error)
    {
        $this->deployment->project->status = Project::FAILED;
        $this->deployment->status          = Deployment::FAILED;

Severity: Minor
Found in app/Jobs/DeployProject.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 presentReadableRuntime has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function presentReadableRuntime()
    {
        if (!$this->getWrappedObject() instanceof RuntimeInterface) {
            throw new RuntimeException(
                'Model ' . get_class($this->getWrappedObject()) . ' must implement RuntimeInterface'
Severity: Minor
Found in app/View/Presenters/RuntimePresenter.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 deploy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function deploy(Request $request, $project_id)
    {
        $project = $this->projectRepository->getById($project_id);

        if ($project->servers->where('deploy_code', true)->count() === 0) {
Severity: Minor
Found in app/Http/Controllers/DeploymentController.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 handle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function handle(EnvFile $writer, Requirements $requirements)
    {
        $this->line('');

        $config = base_path('.env');
Severity: Minor
Found in app/Console/Commands/InstallApp.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

Severity
Category
Status
Source
Language