wikimedia/mediawiki-extensions-Wikibase

View on GitHub
client/data-bridge/src/data-access/ApiPageEditPermissionErrorsRepository.ts

Summary

Maintainability
A
2 hrs
Test Coverage

Function apiErrorToPermissionError has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private apiErrorToPermissionError( error: ApiError, semiProtectedLevels: readonly string[] ): PermissionError {
        assertIsApiErrorRawErrorformat( error );
        switch ( error.code ) {
            case 'protectedpage': {
                const right = error.params[ 0 ] as string;

    Function getPermissionErrors has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public async getPermissionErrors( title: string ): Promise<PermissionError[]> {
            const response = await this.api.get( {
                action: 'query',
                titles: new Set( [ title ] ),
                prop: new Set( [ 'info' ] ),

      There are no issues that match your filters.

      Category
      Status