luyadev/luya-module-admin

View on GitHub
src/apis/ProxyController.php

Summary

Maintainability
A
3 hrs
Test Coverage
B
87%

Showing 4 of 4 total issues

Method actionIndex has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

public function actionIndex($identifier, $token)
{
$machine = ProxyMachine::findOne(['identifier' => $identifier, 'is_deleted' => false]);
 
if (!$machine) {
Severity: Minor
Found in src/apis/ProxyController.php - About 1 hr to fix

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

    public function actionIndex($identifier, $token)
    {
    $machine = ProxyMachine::findOne(['identifier' => $identifier, 'is_deleted' => false]);
     
    if (!$machine) {
    Severity: Minor
    Found in src/apis/ProxyController.php - About 35 mins to fix

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

    public function actionFileProvider($machine, $buildToken, $fileId)
    {
    $build = $this->ensureBuild($machine, $buildToken);
     
    if ($build) {
    Severity: Minor
    Found in src/apis/ProxyController.php - About 25 mins to fix

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

    public function actionImageProvider($machine, $buildToken, $imageId)
    {
    $build = $this->ensureBuild($machine, $buildToken);
     
    if ($build) {
    Severity: Minor
    Found in src/apis/ProxyController.php - About 25 mins to fix
    Category
    Status