Showing 994 of 1,238 total issues
Function normalize
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function normalize( array $validCounts ): void {
$this->formOptions->validateIntBounds( 'days', 1, 10000 );
$this->formOptions->validateIntBounds( 'width', 200, 1000 );
$this->formOptions->validateIntBounds( 'height', 200, 1000 );
- 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 doExport
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function doExport(): Status {
$out = $this->getOutput();
$group = MessageGroups::getGroup( $this->groupId );
$collection = $this->setupCollection( $group );
- 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 getMessages
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getMessages(): array {
if ( $this->messages !== null ) {
return $this->messages;
}
- 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 isTranslatableMessage
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function isTranslatableMessage( MessageHandle $handle, string $targetLanguage ): bool {
static $cache = [];
if ( !$handle->isValid() ) {
return false;
- 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 execute
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$csvFilePath = $this->getArg( 0 );
$username = $this->getOption( 'user' );
$summary = $this->getOption( 'summary' );
- 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 readFromVariable
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function readFromVariable( string $data ): array {
$reader = new SimpleXMLElement( $data );
$messages = [];
$mangler = $this->group->getMangler();
- 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 fixMessageParams
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function fixMessageParams( IContextSource $context, array $params ): array {
$out = [];
$lang = $context->getLanguage();
foreach ( $params as $param ) {
- 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 init
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
LanguageFilter.prototype.init = function () {
var languageFilter = this;
var $clearButton = $( '<button>' )
.addClass( 'clear-language-selector hide' )
Function alignHeaders
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function alignHeaders( units, translationUnits ) {
// The content does not have information about the page title. Add an empty string
// at the beginning of the translationUnits array to match the length of units and
// translationUnits.
if ( units.length && units[ 0 ].identifier === 'Page_display_title' ) {
Function getMaxBorderWidth
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
getMaxBorderWidth: function(arcs) {
var me = this;
var max = 0;
var chart = me.chart;
var i, ilen, meta, arc, controller, options, borderWidth, hoverWidth;
Method getPageList
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getPageList( array $pages, string $type ): string {
$items = [];
$tagsTextCache = [];
$tagDiscouraged = $this->msg( 'tpt-tag-discouraged' )->escaped();
Method deleteAsynchronously
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function deleteAsynchronously(
Title $title,
bool $isTranslation,
UserIdentity $user,
array $subpageList,
Method requeueError
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function requeueError( string $serviceName, Exception $e ): void {
$this->logger->warning(
'Exception thrown while running {command} on ' .
'service {service}: {errorMessage}',
[
Method getRenameJobParams
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getRenameJobParams(
array $currentMsg,
MessageSourceChange $sourceChanges,
string $languageCode,
int $groupNamespace,
Method makeNumberColumns
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function makeNumberColumns( array $stats ): string {
$total = $stats[MessageGroupStats::TOTAL];
$translated = $stats[MessageGroupStats::TRANSLATED];
$fuzzy = $stats[MessageGroupStats::FUZZY];
$proofread = $stats[MessageGroupStats::PROOFREAD];
Method onPageSaveComplete
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function onPageSaveComplete(
$wikiPage,
$user,
$summary,
$flags,
Method execute
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$this->language = $this->getServiceContainer()->getContentLanguage();
$groupInput = $this->getOption( 'group', '*' );
$groupIdPattern = self::commaList2Array( $groupInput );
Method getDefinitions
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getDefinitions() {
$groups = MessageGroups::getAllGroups();
$keys = [];
/** @var $g MessageGroup */
Function interpolate
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function interpolate(start, view, model, ease) {
var keys = Object.keys(model);
var i, ilen, key, actual, origin, target, type, c0, c1;
for (i = 0, ilen = keys.length; i < ilen; ++i) {
Function top
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
top: function ( position, data ) {
var within = data.within,
withinOffset = within.offset.top + within.scrollTop,
outerHeight = within.height,
offsetTop = within.isWindow ? within.scrollTop : within.offset.top,