File SearchTranslationsSpecialPage.php
has 518 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare( strict_types = 1 );
namespace MediaWiki\Extension\Translate\TtmServer;
Method execute
has 199 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute( $subPage ) {
$this->setHeaders();
$this->checkPermissions();
$server = $this->ttmServerFactory->getDefaultForQuerying();
Function execute
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public function execute( $subPage ) {
$this->setHeaders();
$this->checkPermissions();
$server = $this->ttmServerFactory->getDefaultForQuerying();
- 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 messageSelector
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function messageSelector(): string {
$nonDefaults = $this->opts->getChangedValues();
$output = Html::openElement( 'div', [ 'class' => 'row tux-messagetable-header' ] );
$output .= Html::openElement( 'div', [ 'class' => 'twelve columns' ] );
$output .= Html::openElement( 'ul', [ 'class' => 'row tux-message-selector' ] );
Method showSearch
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function showSearch(
string $search,
string $count,
string $facets,
string $results,
Function makeGroupFacetRows
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function makeGroupFacetRows(
array $groups,
array $counts,
int $level = 0,
string $pathString = ''
- 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 makeGroupFacetRows
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function makeGroupFacetRows(
array $groups,
array $counts,
int $level = 0,
string $pathString = ''
Method getSearchInput
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getSearchInput( string $query ): string {
$attribs = [
'placeholder' => $this->msg( 'tux-sst-search-ph' )->text(),
'class' => 'searchinputbox mw-ui-input',
'dir' => $this->getLanguage()->getDir()
Function messageSelector
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function messageSelector(): string {
$nonDefaults = $this->opts->getChangedValues();
$output = Html::openElement( 'div', [ 'class' => 'row tux-messagetable-header' ] );
$output .= Html::openElement( 'div', [ 'class' => 'twelve columns' ] );
$output .= Html::openElement( 'ul', [ 'class' => 'row tux-message-selector' ] );
- 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 showSearch
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string $search,
string $count,
string $facets,
string $results,
int $total
Function getLanguages
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function getLanguages( array $facet ): array {
$output = [];
$nonDefaults = $this->opts->getChangedValues();
$selected = $this->opts->getValue( 'language' );
- 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"