includes/specialpage/SpecialPage.php
SpecialPage
has 70 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class SpecialPage implements MessageLocalizer {
/**
* @var string The canonical name of this special page
* Also used as the message key for the default <h1> heading,
* @see getDescription()
File SpecialPage.php
has 472 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* Parent class for all special pages.
*
* This program is free software; you can redistribute it and/or modify
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();
Function checkLoginSecurityLevel
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function checkLoginSecurityLevel( $level = null ) {
$level = $level ?: $this->getName();
$key = 'SpecialPage:reauth:' . $this->getName();
$request = $this->getRequest();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$name = '', $restriction = '', $listed = true,
$function = false, $file = '', $includable = false
Method buildPrevNextNavigation
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$offset,
$limit,
array $query = [],
$atend = false,
$subpage = false