File SpecialContributions.php
has 752 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Implements Special:Contributions
*
* This program is free software; you can redistribute it and/or modify
Function execute
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
public function execute( $par ) {
$this->setHeaders();
$this->outputHeader();
$out = $this->getOutput();
// Modules required for viewing the list of contributions (also when included on other pages)
- 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 execute
has 201 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute( $par ) {
$this->setHeaders();
$this->outputHeader();
$out = $this->getOutput();
// Modules required for viewing the list of contributions (also when included on other pages)
Method getForm
has 178 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getForm( array $pagerOptions ) {
if ( $this->including() ) {
// Do not show a form when special page is included in wikitext
return '';
}
Function contributionsSub
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
protected function contributionsSub( $userObj, $targetName ) {
$isAnon = $userObj->isAnon();
if ( !$isAnon && $userObj->isHidden() &&
!$this->permissionManager->userHasRight( $this->getUser(), 'hideuser' )
) {
- 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 contributionsSub
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function contributionsSub( $userObj, $targetName ) {
$isAnon = $userObj->isAnon();
if ( !$isAnon && $userObj->isHidden() &&
!$this->permissionManager->userHasRight( $this->getUser(), 'hideuser' )
) {
Method getUserLinks
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getUserLinks(
SpecialPage $sp,
User $target,
PermissionManager $permissionManager = null,
HookRunner $hookRunner = null
Function getUserLinks
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public static function getUserLinks(
SpecialPage $sp,
User $target,
PermissionManager $permissionManager = null,
HookRunner $hookRunner = null
- 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
Function getForm
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function getForm( array $pagerOptions ) {
if ( $this->including() ) {
// Do not show a form when special page is included in wikitext
return '';
}
- 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 12 arguments (exceeds 4 allowed). Consider refactoring. Open
LinkBatchFactory $linkBatchFactory = null,
PermissionManager $permissionManager = null,
IConnectionProvider $dbProvider = null,
RevisionStore $revisionStore = null,
NamespaceInfo $namespaceInfo = null,
Method getPager
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getPager( $targetUser ) {
if ( $this->pager === null ) {
$options = [
'namespace' => $this->opts['namespace'],
'tagfilter' => $this->opts['tagfilter'],
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return;