REBELinBLUE/deployer

View on GitHub

Showing 76 of 2,695 total issues

Function getInstallInformation has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function getInstallInformation()
    {
        $this->header('Installation details');

        $regions = $this->getTimezoneRegions();
Severity: Minor
Found in app/Console/Commands/InstallApp.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 index has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        UserRepositoryInterface $user,
        TemplateRepositoryInterface $templateRepository,
        GroupRepositoryInterface $groupRepository,
        Request $request,
        ViewFactory $view,
Severity: Minor
Found in app/Http/Controllers/Admin/ProjectController.php - About 45 mins to fix

Function update has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function update()
    {
        $prev     = base_path('.env.prev');
        $current  = base_path('.env');
        $dist     = base_path('.env.dist');
Severity: Minor
Found in app/Console/Commands/Installer/EnvFile.php - About 45 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 viewData has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  viewData() {
    const data = this.model.toJSON();

    let css = 'info';
    let icon = 'clock-o';
Severity: Minor
Found in resources/assets/src/views/Logs.js - About 45 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 __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        UserRepositoryInterface $repository,
        Google2FA $google2fa,
        ViewFactory $view,
        Translator $translator,
        Redirector $redirector,
Severity: Minor
Found in app/Http/Controllers/ProfileController.php - About 45 mins to fix

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

        ConfigRepository $config,
        Filesystem $filesystem,
        TokenGeneratorInterface $tokenGenerator,
        ProcessBuilder $builder,
        ValidationFactory $validator,
Severity: Minor
Found in app/Console/Commands/InstallApp.php - About 45 mins to fix

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

        CommandRepositoryInterface $commandRepository,
        TemplateRepositoryInterface $templateRepository,
        ViewFactory $view,
        Translator $translator,
        UrlGenerator $url
Severity: Minor
Found in app/Http/Controllers/Admin/TemplateController.php - About 35 mins to fix

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

        JWTAuth $jwt,
        Dispatcher $dispatcher,
        Redirector $redirector,
        ResponseFactory $response,
        AuthFactory $auth
Severity: Minor
Found in app/Http/Middleware/RefreshJsonWebToken.php - About 35 mins to fix

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

    public function __construct(Deployment $deployment, ServerLog $log, $local_file, $remote_file, $key)
Severity: Minor
Found in app/Jobs/DeployProject/SendFileToServer.php - About 35 mins to fix

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

        ProjectRepositoryInterface $projectRepository,
        DeploymentRepositoryInterface $deploymentRepository,
        ViewFactory $view,
        Translator $translator,
        Redirector $redirect
Severity: Minor
Found in app/Http/Controllers/DeploymentController.php - About 35 mins to fix

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

    public function askAndValidate($question, array $choices, $validator, $default = null, $secret = false)
Severity: Minor
Found in app/Console/Commands/Traits/AskAndValidate.php - About 35 mins to fix

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

    public function listing($target_id, $action, Translator $translator, ViewFactory $view, UrlGenerator $url)
Severity: Minor
Found in app/Http/Controllers/Resources/CommandController.php - About 35 mins to fix

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

        Process $process,
        ConfigRepository $config,
        RedisManager $redis,
        QueueManager $queue,
        Filesystem $filesystem
Severity: Minor
Found in app/Console/Commands/Installer/Requirements.php - About 35 mins to fix

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

    public function getCommitUrlAttribute()
    {
        if ($this->commit !== self::LOADING) {
            $info = $this->project->accessDetails();
            if (isset($info['domain']) && isset($info['reference'])) {
Severity: Minor
Found in app/Deployment.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 handlePush has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function handlePush()
    {
        // Get the branch if it is the request, otherwise deploy the default branch
        $branch = $this->request->has('branch') ? $this->request->get('branch') : null;

Severity: Minor
Found in app/Services/Webhooks/Custom.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 getRepositoryUrlAttribute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRepositoryUrlAttribute()
    {
        $info = $this->accessDetails();

        if (isset($info['domain']) && isset($info['reference'])) {
Severity: Minor
Found in app/Project.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 handle has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function handle()
    {
        $period = [];

        $minute = (int) (Carbon::now()->format('i'));
Severity: Minor
Found in app/Console/Commands/CheckUrls.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 'primary';
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.failed');
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->process->setScript($script, $tokens, Process::DIRECT_INPUT);
Severity: Major
Found in app/Jobs/DeployProject/ScriptBuilder.php - About 30 mins to fix
Severity
Category
Status
Source
Language