Showing 1,238 of 1,238 total issues
File Chart.js
has 11466 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Chart.js v2.9.3
* https://www.chartjs.org
* (c) 2019 Chart.js Contributors
* Released under the MIT License
Similar blocks of code found in 2 locations. Consider refactoring. Open
var colorName$1 = {
"aliceblue": [240, 248, 255],
"antiquewhite": [250, 235, 215],
"aqua": [0, 255, 255],
"aquamarine": [127, 255, 212],
- 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 1339.
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
var colorName = {
"aliceblue": [240, 248, 255],
"antiquewhite": [250, 235, 215],
"aqua": [0, 255, 255],
"aquamarine": [127, 255, 212],
- 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 1339.
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 conversions
has 682 lines of code (exceeds 25 allowed). Consider refactoring. Open
var conversions = createCommonjsModule(function (module) {
/* MIT license */
// NOTE: conversions should only return primitive values (i.e. arrays, or
File Hooks.php
has 1201 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace MediaWiki\Extension\Translate\PageTranslation;
use Article;
Function execute
has a Cognitive Complexity of 150 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$output = $this->getOption( 'output', 'default' );
// Select an output engine
switch ( $output ) {
- 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 PageTranslationSpecialPage.php
has 1046 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare( strict_types = 1 );
namespace MediaWiki\Extension\Translate\PageTranslation;
File ext.translate.editor.js
has 1033 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* global autosize */
( function () {
'use strict';
Function core_helpers
has 468 lines of code (exceeds 25 allowed). Consider refactoring. Open
var core_helpers = function() {
// -- Basic js utility methods
helpers$1.where = function(collection, filterCallback) {
File Translate.alias.php
has 935 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Aliases for special pages of Translate extension.
*
* @file
File ManageGroupsSpecialPage.php
has 906 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare( strict_types = 1 );
namespace MediaWiki\Extension\Translate\Synchronization;
File HookHandler.php
has 726 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare( strict_types=1 );
namespace MediaWiki\Extension\Translate;
Function prepareEditorColumn
has 332 lines of code (exceeds 25 allowed). Consider refactoring. Open
prepareEditorColumn: function () {
var translateEditor = this,
$discardChangesButton = $( [] ),
$saveButton = $( [] ),
$messageTools = translateEditor.createMessageTools(),
Method execute
has 285 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$output = $this->getOption( 'output', 'default' );
// Select an output engine
switch ( $output ) {
Identical blocks of code found in 2 locations. Consider refactoring. Open
legendCallback: function(chart) {
var list = document.createElement('ul');
var data = chart.data;
var datasets = data.datasets;
var labels = data.labels;
- 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 258.
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
legendCallback: function(chart) {
var list = document.createElement('ul');
var data = chart.data;
var datasets = data.datasets;
var labels = data.labels;
- 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 258.
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 ext.translate.messagetable.js
has 621 lines of code (exceeds 250 allowed). Consider refactoring. Open
( function () {
'use strict';
var itemsClass = {
proofread: '.tux-message-proofread',
Function execute
has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring. Open
public function execute( array $messages ): bool {
$context = RequestContext::getMain();
$output = $context->getOutput();
// Set up diff engine
- 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
Method setupTranslate
has 258 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function setupTranslate(): void {
global $wgTranslateYamlLibrary, $wgLogTypes;
$hooks = [];
/*
Function execute
has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring. Open
public function execute(): void {
$this->checkUserRightsAny( self::$right );
$block = $this->getUser()->getBlock();
if ( $block && $block->isSitewide() ) {
$this->dieBlocked( $block );
- 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"