File LogEventsList.php
has 502 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Contain classes to list log entries
*
* Copyright © 2004 Brooke Vibber <bvibber@wikimedia.org>
Method showLogExtract
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function showLogExtract(
&$out, $types = [], $page = '', $user = '', $param = []
) {
$defaultParameters = [
'lim' => 25,
Function showLogExtract
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public static function showLogExtract(
&$out, $types = [], $page = '', $user = '', $param = []
) {
$defaultParameters = [
'lim' => 25,
- 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 getShowHideLinks
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
private function getShowHideLinks( $row ) {
// We don't want to see the links and
if ( $this->flags == self::NO_ACTION_LINK ) {
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 showOptions
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function showOptions( $type = '', $year = 0, $month = 0, $day = 0 ) {
$formDescriptor = [];
// Basic selectors
$formDescriptor['type'] = $this->getTypeMenuDesc();
Method logLine
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function logLine( $row ) {
$entry = DatabaseLogEntry::newFromRow( $row );
$formatter = LogFormatter::newFromEntry( $entry );
$formatter->setContext( $this->getContext() );
$formatter->setLinkRenderer( $this->getLinkRenderer() );
Method getShowHideLinks
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getShowHideLinks( $row ) {
// We don't want to see the links and
if ( $this->flags == self::NO_ACTION_LINK ) {
return '';
}
Method getTypeMenuDesc
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getTypeMenuDesc() {
$typesByName = [];
// Load the log names
foreach ( LogPage::validTypes() as $type ) {
$page = new LogPage( $type );
Function getExcludeClause
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getExcludeClause( $db, $audience = 'public', Authority $performer = null ) {
$logRestrictions = MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::LogRestrictions );
if ( $audience != 'public' && $performer === null ) {
throw new InvalidArgumentException(
- 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 showLogExtract
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
&$out, $types = [], $page = '', $user = '', $param = []
Function showOptions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function showOptions( $type = '', $year = 0, $month = 0, $day = 0 ) {
$formDescriptor = [];
// Basic selectors
$formDescriptor['type'] = $this->getTypeMenuDesc();
- 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 getTypeMenuDesc
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getTypeMenuDesc() {
$typesByName = [];
// Load the log names
foreach ( LogPage::validTypes() as $type ) {
$page = new LogPage( $type );
- 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"