wikimedia/mediawiki-extensions-Translate

View on GitHub
src/TranslatorSandbox/TranslateSandbox.php

Summary

Maintainability
B
6 hrs
Test Coverage

Method sendEmail has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function sendEmail( User $sender, User $target, string $type ): void {
        $emergencyContact = $this->options->get( 'EmergencyContact' );

        $targetLang = $this->userOptionsManager->getOption( $target, 'language' );

Severity: Minor
Found in src/TranslatorSandbox/TranslateSandbox.php - About 1 hr to fix

    Method deleteUser has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function deleteUser( User $user, string $force = '' ): void {
            $uid = $user->getId();
            $actorId = $user->getActorId();
    
            if ( $force !== 'force' && !self::isSandboxed( $user ) ) {
    Severity: Minor
    Found in src/TranslatorSandbox/TranslateSandbox.php - About 1 hr to fix

      Method addUser has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function addUser( string $name, string $email, string $password ): User {
              $user = $this->userFactory->newFromName( $name, UserFactory::RIGOR_CREATABLE );
      
              if ( !$user ) {
                  throw new InvalidArgumentException( 'Invalid user name' );
      Severity: Minor
      Found in src/TranslatorSandbox/TranslateSandbox.php - About 1 hr to fix

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

                UserFactory $userFactory,
                IConnectionProvider $dbProvider,
                PermissionManager $permissionManager,
                AuthManager $authManager,
                UserGroupManager $userGroupManager,
        Severity: Major
        Found in src/TranslatorSandbox/TranslateSandbox.php - About 1 hr to fix

          There are no issues that match your filters.

          Category
          Status