rene-s/Seafile-PHP-SDK

View on GitHub
src/Resource/File.php

Summary

Maintainability
C
1 day
Test Coverage

File File.php has 319 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace Seafile\Client\Resource;

use Exception;
Severity: Minor
Found in src/Resource/File.php - About 3 hrs to fix

    Method copy has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function copy(
            LibraryType $srcLibrary,
            string      $srcFilePath,
            LibraryType $dstLibrary,
            string      $dstDirectoryPath,
    Severity: Minor
    Found in src/Resource/File.php - About 1 hr to fix

      Method rename has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function rename(LibraryType $library, DirectoryItem $dirItem, string $newFilename): bool
          {
              $filePath = $dirItem->dir . $dirItem->name;
      
              if (empty($filePath)) {
      Severity: Minor
      Found in src/Resource/File.php - About 1 hr to fix

        Method getMultiPartParams has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getMultiPartParams(
                string $localFilePath,
                string $dir,
                bool   $newFile = true,
                       $newFilename = false
        Severity: Minor
        Found in src/Resource/File.php - About 1 hr to fix

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

                  LibraryType   $library,
                  DirectoryItem $item,
                  string        $localFilePath,
                  string        $dir,
                  int           $reuse = 1
          Severity: Minor
          Found in src/Resource/File.php - About 35 mins to fix

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

                    LibraryType $library,
                    string      $localFilePath,
                    string      $dir = '/',
                                $newFilename = false,
                    bool        $newFile = true
            Severity: Minor
            Found in src/Resource/File.php - About 35 mins to fix

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

                      LibraryType $srcLibrary,
                      string      $srcFilePath,
                      LibraryType $dstLibrary,
                      string      $dstDirectoryPath,
                      int         $operation = self::OPERATION_COPY
              Severity: Minor
              Found in src/Resource/File.php - About 35 mins to fix

                There are no issues that match your filters.

                Category
                Status