Showing 1,238 of 1,238 total issues
Function draw
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
draw: function() {
var me = this;
var ctx = me.ctx;
var opts = me.options;
Method startSync
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function startSync( array $modificationJobs, array $renameJobs ): void {
// We are adding an empty array for groups that have no jobs. This is mainly done to
// avoid adding unnecessary checks. Remove those using array_filter
$modificationGroupIds = array_keys( array_filter( $modificationJobs ) );
$renameGroupIds = array_keys( array_filter( $renameJobs ) );
Method showRenames
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function showRenames(
MessageGroup $group,
MessageSourceChange $sourceChanges,
OutputPage $out,
string $language,
Method getMessageParameters
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getMessageParameters(): array {
$params = parent::getMessageParameters();
$legacy = $this->entry->getParameters();
$type = $this->entry->getFullType();
Method writeReal
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeReal( MessageCollection $collection ): string {
global $wgTranslateDocumentationLanguageCode;
$collection->filter( 'hastranslation', false );
if ( count( $collection ) === 0 ) {
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ( this.options.targetlangcode === mw.config.get( 'wgTranslateDocumentationLanguageCode' ) ) {
targetLangAttrib = mw.config.get( 'wgContentLanguage' );
} else {
targetLangAttrib = this.options.targetlangcode;
}
- 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 69.
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
if ( this.options.targetlangcode === mw.config.get( 'wgTranslateDocumentationLanguageCode' ) ) {
targetLangAttrib = mw.config.get( 'wgContentLanguage' );
} else {
targetLangAttrib = this.options.targetlangcode;
}
- 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 69.
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
Function getBackgroundPoint
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getBackgroundPoint(vm, size, alignment, chart) {
// Background Position
var x = vm.x;
var y = vm.y;
Function updateElement
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateElement: function(arc, index, reset) {
var me = this;
var chart = me.chart;
var chartArea = chart.chartArea;
var opts = chart.options;
Function search
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
search: function ( query ) {
var resultCount = 0,
matcher = new RegExp( '(^|\\s|\\b)' + escapeRegex( query ), 'i' );
this.$container.find( itemsClass[ this.mode ] ).each( function () {
Method fetchTranslatableTemplateAndTitle
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function fetchTranslatableTemplateAndTitle(
?LinkTarget $contextLink,
?LinkTarget $templateLink,
bool &$skip,
?RevisionRecord &$revRecord
Method sourcePageHeader
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function sourcePageHeader( IContextSource $context ) {
$linker = MediaWikiServices::getInstance()->getLinkRenderer();
$language = $context->getLanguage();
$title = $context->getTitle();
Method processGroups
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function processGroups( array $groups ): array {
$fixedGroups = [];
foreach ( $groups as $g ) {
$name = $g['name'];
$sanitizedName = preg_replace( '/\s+/', '', strtolower( $name ) );
Method beginBootstrap
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function beginBootstrap(): void {
$this->checkElasticsearchVersion();
$index = $this->getIndex();
if ( $this->updateMapping ) {
$this->logOutput( 'Updating the index mappings...' );
Method extractMessages
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function extractMessages( array $documents ): array {
$messages = $ret = [];
$language = $this->params['language'];
foreach ( $documents as $document ) {
Method identifySafeLanguages
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function identifySafeLanguages(
FileBasedMessageGroup $group,
MessageSourceChange $changesForGroup,
int $importStrategy
): array {
Method getParentGroups
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getParentGroups( MessageGroup $targetGroup ): array {
$ids = self::getSharedGroups( $targetGroup );
if ( $ids === [] ) {
return [];
}
Similar blocks of code found in 2 locations. Consider refactoring. Open
helpers$1.min = function(array) {
return array.reduce(function(min, value) {
if (!isNaN(value)) {
return Math.min(min, value);
}
- 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 68.
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 3 locations. Consider refactoring. Open
if (a < 1) {
a = 1;
s = p / 4;
} else {
s = p / (2 * Math.PI) * Math.asin(1 / a);
- 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 68.
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 3 locations. Consider refactoring. Open
if (a < 1) {
a = 1;
s = p / 4;
} else {
s = p / (2 * Math.PI) * Math.asin(1 / a);
- 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 68.
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