Showing 11,545 of 11,545 total issues
Function run
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function run( $resultPageSet = null ) {
$params = $this->extractRequestParams();
if ( isset( $params['title'] ) && !isset( $params['lang'] ) ) {
$this->dieWithError(
- 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 outputPageList
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
private function outputPageList( $groups ) {
$out = $this->getOutput();
// Legend
$includesRestrictedPages = 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 internalRemoveHtmlTags
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public static function internalRemoveHtmlTags( string $text, ?callable $processCallback = null,
$args = [], array $extratags = [], array $removetags = []
): string {
$tagData = self::getRecognizedTagData( $extratags, $removetags );
$htmlsingle = $tagData['htmlsingle'];
- 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 extensionSubstitution
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function extensionSubstitution( array $params, PPFrame $frame, bool $processNowiki = false ) {
static $errorStr = '<span class="error">';
$name = $frame->expand( $params['name'] );
if ( str_starts_with( $name, $errorStr ) ) {
- 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 31 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
if ( $this->hasOption( 'd' ) ) {
$d = $this->getOption( 'd' );
if ( $d > 0 ) {
LoggerFactory::registerProvider( new ConsoleSpi );
- 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
File Makefile.py
has 357 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @author Philip
import os
import platform
Function setupFields
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
mw.widgets.datetime.DateTimeInputWidget.prototype.setupFields = function () {
let i, $field, spec, placeholder, sz, maxlength;
const
spanValFunc = function ( v ) {
Function p
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
var p = new Promise(function (resolve, reject) {
if (search == 'farzher') return resolve([{
target: "farzher was here (^-^*)/",
score: 0,
indexes: [0, 1, 2, 3, 4, 5, 6],
Method formatValue
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function formatValue( $field, $value ) {
/** @var stdClass $row */
$row = $this->mCurrentRow;
$linkRenderer = $this->getLinkRenderer();
Similar blocks of code found in 2 locations. Consider refactoring. Open
mw.widgets.RowWidget.prototype.removeItems = function ( items ) {
OO.ui.mixin.GroupElement.prototype.removeItems.call( this, items );
const cells = this.getItems();
for ( let i = 0, len = cells.length; i < len; i++ ) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 126.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
mw.widgets.TableWidget.prototype.removeItems = function ( items ) {
OO.ui.mixin.GroupElement.prototype.removeItems.call( this, items );
const rows = this.getItems();
for ( let i = 0, len = rows.length; i < len; i++ ) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 126.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File SettingsBuilder.php
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace MediaWiki\Settings;
use MediaWiki\Config\Config;
File IPTC.php
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Class for some IPTC functions.
*
* This program is free software; you can redistribute it and/or modify
Function MWWDateInputWidget
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
mw.widgets.DateInputWidget = function MWWDateInputWidget( config ) {
// Config initialization
config = Object.assign( {
precision: 'day',
longDisplayFormat: false,
File CLDRPluralRuleParser.js
has 355 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* cldrpluralparser.js
* A parser engine for CLDR plural rules.
*
* Copyright 2012-2014 Santhosh Thottingal and other contributors
Method prepareContent
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function prepareContent(
UserIdentity $user,
RevisionSlotsUpdate $slotsUpdate,
$useStash = true
) {
SessionBackend
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
final class SessionBackend {
/** @var SessionId */
private $id;
/** @var bool */
Similar blocks of code found in 2 locations. Consider refactoring. Open
OO.ui.TagItemWidget.prototype.toggleValid = function ( valid ) {
valid = valid === undefined ? !this.valid : !!valid;
if ( this.valid !== valid ) {
this.valid = valid;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 125.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
OO.ui.TagMultiselectWidget.prototype.toggleValid = function ( valid ) {
valid = valid === undefined ? !this.valid : !!valid;
if ( this.valid !== valid ) {
this.valid = valid;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 125.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File jquery.ui.button.js
has 354 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* jQuery UI Button 1.9.2
* http://jqueryui.com
*
* Copyright 2012 jQuery Foundation and other contributors