Showing 994 of 1,238 total issues
MessageBundleMessageGroup
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class MessageBundleMessageGroup implements MessageGroup {
/** Name of the bundle (prefixed text of the bundle page) */
private string $name;
private string $groupId;
private int $pageId;
Function splineCurveMonotone
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
helpers$1.splineCurveMonotone = function(points) {
// This function calculates Bézier control points in a similar way than |splineCurve|,
// but preserves monotonicity of the provided data and ensures no local extremums are added
// between the dataset discrete points due to the interpolation.
// See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation
Method formatGroup
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function formatGroup( $mixed, array $props, int $depth = 0 ): array {
$params = $this->extractRequestParams();
$context = $this->getContext();
// Default
File MessageSourceChange.php
has 282 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Contains a class to track changes to the messages when importing messages from remote source.
* @author Abijeet Patro
* @license GPL-2.0-or-later
Function save
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
save: function () {
var translateEditor = this;
mw.hook( 'mw.translate.editor.beforeSubmit' ).fire( translateEditor.$editor );
var translation = translateEditor.$editor.find( '.tux-textarea-translation' ).val();
Function showData
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showData( apiResponse, options ) {
var graphData = getAxesLabelsAndData( apiResponse.data ),
graphDatasets = [],
datasetLabels = apiResponse.labels;
Method createMessageGroup
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function createMessageGroup( string $id, array $info ): MessageGroup {
$conf = [];
$conf['BASIC']['class'] = MediaWikiExtensionMessageGroup::class;
$conf['BASIC']['id'] = $id;
$conf['BASIC']['namespace'] = $this->getNamespace();
Function execute
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
global $wgSitename, $wgTranslateMessageNamespaces;
$days = (int)$this->getOption( 'days', 30 );
$top = (int)$this->getOption( 'top', -1 );
- 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 20 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
global $wgTranslateMessageNamespaces;
$namespace = $this->getOption( 'namespace', $wgTranslateMessageNamespaces );
$nsInfo = MediaWikiServices::getInstance()->getNamespaceInfo();
- 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 parseQueryString
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private function parseQueryString( string $queryString, array $opts ): array {
$fields = $highlights = [];
$terms = preg_split( '/\s+/', $queryString );
$match = $opts['match'];
$case = $opts['case'];
- 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 20 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$params = $this->extractRequestParams();
$title = Title::newFromText( $params['title'] );
if ( !$title ) {
- 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 20 (exceeds 5 allowed). Consider refactoring. Open
public function execute( $par ) {
$this->target = $this->getLanguage()->getCode();
$request = $this->getRequest();
$this->purge = $request->getVal( 'action' ) === 'purge';
- 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 parseGettext
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private function parseGettext( string $data ): array {
$mangler = $this->group->getMangler();
$useCtxtAsKey = $this->extra['CtxtAsKey'] ?? false;
$keyAlgorithm = 'simple';
if ( isset( $this->extra['keyAlgorithm'] ) ) {
- 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 AggregateGroupsActionApi.php
has 280 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare( strict_types = 1 );
namespace MediaWiki\Extension\Translate\MessageGroupProcessing;
Method execute
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute( $par ) {
$request = $this->getRequest();
$user = $this->getUser();
$this->addHelpLink( 'Help:Extension:Translate/Move_translatable_page' );
$out = $this->getOutput();
Method markForTranslation
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function markForTranslation(
TranslatablePageMarkOperation $operation,
TranslatablePageSettings $pageSettings,
User $user
): int {
Method showConfirmation
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function showConfirmation(): void {
$out = $this->getOutput();
$count = 0;
$subpageCount = 0;
File ExportTranslationsSpecialPage.php
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare( strict_types = 1 );
namespace MediaWiki\Extension\Translate\Synchronization;
Utilities
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class Utilities {
/**
* Does quick normalisation of message name so that in can be looked from the
* database.
* @param string $message Name of the message
Method __construct
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct() {
parent::__construct();
$this->addDescription( 'Script to generate statistics about the localisation ' .
'level of one or more message groups.' );
$this->addOption(