Showing 11,461 of 11,461 total issues
Function makeApi
has 332 lines of code (exceeds 25 allowed). Consider refactoring. Open
function makeApi(sinon) {
var push = [].push;
var match = sinon.match;
function mock(object) {
Function Assert
has 330 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Assert = /*#__PURE__*/function () {
function Assert(testContext) {
_classCallCheck(this, Assert);
this.test = testContext;
}
Function profilePreferences
has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring. Open
protected function profilePreferences(
User $user, IContextSource $context, &$defaultPreferences
) {
// retrieving user name for GENDER and misc.
$userName = $user->getName();
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
'default' =>
// This array should be sorted by key
[
'ccmeonemails' => 0,
'date' => 'default',
- 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 350.
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
'DefaultUserOptions' => [
'ccmeonemails' => 0,
'date' => 'default',
'diffonly' => 0,
'diff-type' => 'table',
- 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 350.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
_adjustOffsetFromHelper: function(obj) {
if (typeof obj == 'string') {
obj = obj.split(' ');
}
if (Array.isArray(obj)) {
- 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 296.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
_adjustOffsetFromHelper: function(obj) {
if (typeof obj == 'string') {
obj = obj.split(' ');
}
if (Array.isArray(obj)) {
- 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 296.
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
Method continueAccountCreation
has 326 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function continueAccountCreation( array $reqs ) {
$session = $this->request->getSession();
try {
if ( !$this->canCreateAccounts() ) {
// Caller should have called canCreateAccounts()
File ContributionsSpecialPage.php
has 707 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Implements Special:Contributions
*
* This program is free software; you can redistribute it and/or modify
File SpecialBlock.php
has 707 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
Function parse
has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring. Open
public static function parse( $rawData ) {
$parsed = iptcparse( $rawData );
$data = [];
if ( !is_array( $parsed ) ) {
return $data;
- 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 makeThumbLink2
has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring. Open
public static function makeThumbLink2(
LinkTarget $title, $file, $frameParams = [], $handlerParams = [],
$time = false, $query = '', array $classes = [], ?Parser $parser = null
) {
$exists = $file && $file->exists();
- 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 ApiQueryRevisionsBase.php
has 703 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
*
* This program is free software; you can redistribute it and/or modify
Method execute
has 320 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
// Before doing anything at all, let's check permissions
$this->checkUserRightsAny( 'deletedhistory' );
$this->addDeprecation( 'apiwarn-deprecation-deletedrevs', 'action=query&list=deletedrevs' );
File Controller.js
has 699 lines of code (exceeds 250 allowed). Consider refactoring. Open
var byteLength = require( 'mediawiki.String' ).byteLength,
UriProcessor = require( './UriProcessor.js' ),
Controller;
/* eslint no-underscore-dangle: "off" */
Function toHTML
has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring. Open
public function toHTML() {
$resolveFilesViaParser = $this->mParser instanceof Parser;
if ( $resolveFilesViaParser ) {
$parserOutput = $this->mParser->getOutput();
$repoGroup = null;
- 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
CoreParserFunctions
has 84 functions (exceeds 20 allowed). Consider refactoring. Open
class CoreParserFunctions {
/** @var int Assume that no output will later be saved this many seconds after parsing */
private const MAX_TTS = 900;
/**
FileRepo
has 84 functions (exceeds 20 allowed). Consider refactoring. Open
class FileRepo {
public const DELETE_SOURCE = 1;
public const OVERWRITE = 2;
public const OVERWRITE_SAME = 4;
public const SKIP_LOCKING = 8;
File oojs.js
has 693 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* OOjs v7.0.1
* https://www.mediawiki.org/wiki/OOjs
*
* Copyright 2011-2023 OOjs Team and other contributors.
File ParsoidHandler.php
has 693 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Copyright (C) 2011-2020 Wikimedia Foundation and others.
*
* This program is free software; you can redistribute it and/or modify