File SpecialTags.php
has 361 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
Method doTagRow
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function doTagRow(
$tag, $hitcount, $showManageActions, $showDeleteActions, $showEditLinks
) {
$newRow = '';
$newRow .= Xml::tags( 'td', null, Xml::element( 'code', null, $tag ) );
Method showTagList
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function showTagList() {
$out = $this->getOutput();
$out->setPageTitleMsg( $this->msg( 'tags-title' ) );
$out->wrapWikiMsg( "<div class='mw-tags-intro'>\n$1\n</div>", 'tags-intro' );
Function doTagRow
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
private function doTagRow(
$tag, $hitcount, $showManageActions, $showDeleteActions, $showEditLinks
) {
$newRow = '';
$newRow .= Xml::tags( 'td', null, Xml::element( 'code', null, $tag ) );
- 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 showDeleteTagForm
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function showDeleteTagForm( $tag ) {
$authority = $this->getAuthority();
if ( !$authority->isAllowed( 'deletechangetags' ) ) {
throw new PermissionsError( 'deletechangetags' );
}
Method showActivateDeactivateForm
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function showActivateDeactivateForm( $tag, $activate ) {
$actionStr = $activate ? 'activate' : 'deactivate';
$authority = $this->getAuthority();
if ( !$authority->isAllowed( 'managechangetags' ) ) {
Method processCreateTagForm
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function processCreateTagForm( array $data, HTMLForm $form ) {
$context = $form->getContext();
$out = $context->getOutput();
$tag = trim( strval( $data['Tag'] ) );
Function showTagList
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function showTagList() {
$out = $this->getOutput();
$out->setPageTitleMsg( $this->msg( 'tags-title' ) );
$out->wrapWikiMsg( "<div class='mw-tags-intro'>\n$1\n</div>", 'tags-intro' );
- 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 doTagRow
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$tag, $hitcount, $showManageActions, $showDeleteActions, $showEditLinks
Function showDeleteTagForm
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function showDeleteTagForm( $tag ) {
$authority = $this->getAuthority();
if ( !$authority->isAllowed( 'deletechangetags' ) ) {
throw new PermissionsError( 'deletechangetags' );
}
- 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 showActivateDeactivateForm
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function showActivateDeactivateForm( $tag, $activate ) {
$actionStr = $activate ? 'activate' : 'deactivate';
$authority = $this->getAuthority();
if ( !$authority->isAllowed( 'managechangetags' ) ) {
- 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"