gboudreau/Greyhole

View on GitHub
web-app/init.inc.php

Summary

Maintainability
D
1 day
Test Coverage

File init.inc.php has 631 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/*
Copyright 2020 Guillaume Boudreau

This file is part of Greyhole.
Severity: Major
Found in web-app/init.inc.php - About 1 day to fix

    Avoid deeply nested control flow statements.
    Open

                        if (file_exists($path_to_delete)) {
                            $rm_command = "rm -rf " . escapeshellarg($path_to_delete);
                            error_log($rm_command);
                            exec($rm_command);
    
    
    Severity: Major
    Found in web-app/init.inc.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                      if ($return_var) {
                          $output = implode(" ", $output);
                          echo json_encode(['result' => 'error', 'message' => "Error: UNIX user doesn't not exist, and failed to create ($output).\nYou can only create Samba users for existing UNIX users."]);
                      }
      Severity: Major
      Found in web-app/init.inc.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if (!is_dir($v)) {
                                echo json_encode(['result' => 'error', 'message' => "Specified dir not found: " . $v]);
                                exit();
                            }
        Severity: Major
        Found in web-app/init.inc.php - About 45 mins to fix

          There are no issues that match your filters.

          Category
          Status