Showing 11,545 of 11,545 total issues
Method deserialize
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function deserialize( $json, string $expectedClass = null ) {
Assert::parameterType( [ 'stdClass', 'array', 'string' ], $json, '$json' );
Assert::precondition(
!$expectedClass || is_subclass_of( $expectedClass, JsonDeserializable::class ),
'$expectedClass parameter must be subclass of JsonDeserializable, got ' . $expectedClass
Method constructSlotRecords
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function constructSlotRecords(
$revId,
$slotRows,
$queryFlags,
PageIdentity $page,
Method detectNonSerializableDataInternal
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function detectNonSerializableDataInternal(
$value,
bool $expectDeserialize,
string $accumulatedPath,
bool $exhaustive = false
Method doCreateInternal
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function doCreateInternal( array $params ) {
$status = $this->newStatus();
[ $dstCont, $dstRel ] = $this->resolveStoragePathReal( $params['dst'] );
if ( $dstRel === null ) {
Method doQuickOperationsInternal
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
final protected function doQuickOperationsInternal( array $ops, array $opts ) {
/** @noinspection PhpUnusedLocalVariableInspection */
$ps = $this->scopedProfileSection( __METHOD__ . "-{$this->name}" );
$status = $this->newStatus();
Method validateCookieDomain
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function validateCookieDomain( $domain, $originDomain = null ) {
$dc = explode( ".", $domain );
// Don't allow a trailing dot or addresses without a or just a leading dot
if ( substr( $domain, -1 ) == '.' ||
Method doGetMulti
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function doGetMulti( array $keys, $flags = 0 ) {
$blobsFound = [];
[ $keysByServer, $connByServer ] = $this->getConnectionsForKeys( $keys );
foreach ( $keysByServer as $server => $batchKeys ) {
Method parseAccept
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function parseAccept( $accept ): array {
$accepts = explode( ',', $accept ); // FIXME: Allow commas in quotes
$ret = [];
foreach ( $accepts as $i => $a ) {
Method scaleLoads
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function scaleLoads( array &$weightByServer ) {
if ( count( $weightByServer ) <= 1 ) {
// Single-server group; relative adjustments are pointless
return;
}
Method showPreview
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function showPreview( RevisionRecord $rev ) {
// Mostly copied from EditPage::getPreviewText()
$out = $this->getOutput();
try {
Method __construct
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct(
$url, array $options, $caller = __METHOD__, Profiler $profiler = null
) {
$this->urlUtils = MediaWikiServices::getInstance()->getUrlUtils();
if ( !array_key_exists( 'timeout', $options )
Method performAction
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function performAction( Article $article, Title $requestTitle ) {
$request = $this->getRequest();
$output = $this->getOutput();
$title = $this->getTitle();
$user = $this->getUser();
Method getInputCodex
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getInputCodex( $value, $hasErrors ) {
$textareaClasses = [ 'cdx-text-area__textarea' ];
if ( $this->mClass !== '' ) {
$textareaClasses[] = $this->mClass;
}
Method getHumanTimestampInternal
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getHumanTimestampInternal(
MWTimestamp $ts, MWTimestamp $relativeTo, User $user
) {
$diff = $ts->diff( $relativeTo );
$diffDay = (bool)( (int)$ts->timestamp->format( 'w' ) -
Method swapICCProfile
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function swapICCProfile( $filepath, array $colorSpaces,
array $oldProfileStrings, $profileFilepath
) {
$exiftool = MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::Exiftool );
Method rasterize
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function rasterize( $srcPath, $dstPath, $width, $height, $lang = false ) {
$mainConfig = MediaWikiServices::getInstance()->getMainConfig();
$svgConverters = $mainConfig->get( MainConfigNames::SVGConverters );
$svgConverter = $mainConfig->get( MainConfigNames::SVGConverter );
$svgConverterPath = $mainConfig->get( MainConfigNames::SVGConverterPath );
Method doAdd
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function doAdd( $path, $params, $options, $key = null ) {
// Make sure all paths start with a /
if ( $path[0] !== '/' ) {
$path = '/' . $path;
}
Method __construct
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct( Installer $installer ) {
$this->installer = $installer;
$this->extensions = $installer->getVar( '_Extensions' );
$this->skins = $installer->getVar( '_Skins' );
Method checkLoginSecurityLevel
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function checkLoginSecurityLevel( $level = null ) {
$level = $level ?: $this->getName();
$key = 'SpecialPage:reauth:' . $this->getName();
$request = $this->getRequest();
Method getAllowedParams
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getAllowedParams() {
$ret = [
'prop' => [
ParamValidator::PARAM_ISMULTI => true,
ParamValidator::PARAM_DEFAULT => 'ids|title|url',