Showing 1,238 of 1,238 total issues
Function rgb
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
convert.hwb.rgb = function (hwb) {
var h = hwb[0] / 360;
var wh = hwb[1] / 100;
var bl = hwb[2] / 100;
var ratio = wh + bl;
Function longestText
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
helpers$1.longestText = function(ctx, font, arrayOfThings, cache) {
cache = cache || {};
var data = cache.data = cache.data || {};
var gc = cache.garbageCollect = cache.garbageCollect || [];
Method filterChanged
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function filterChanged( array $keys, bool $condition ): array {
$this->loadData( $keys );
$origKeys = [];
if ( !$condition ) {
Method translateTab
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function translateTab( Skin $skin, array &$tabs ) {
$title = $skin->getTitle();
$handle = new MessageHandle( $title );
$code = $handle->getCode();
$page = TranslatablePage::isTranslationPage( $title );
Method getOutput
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getOutput( MessageGroup $group ): array {
$out = [];
$groupId = $group->getId();
$sourceLanguage = $group->getSourceLanguage();
Method update
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function update( MessageHandle $handle, ?string $targetText ): bool {
if ( !$handle->isValid() || $handle->getCode() === '' ) {
return false;
}
Method getTranslationsWithFallback
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getTranslationsWithFallback(
MessageBundle $messageBundle,
string $languageCode,
bool $skipFallbacks
): array {
Method __construct
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct() {
parent::__construct();
$this->addDescription( 'Backport translations from one branch to another.' );
$this->addOption(
Method removeFromCache
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function removeFromCache( Title $title ): void {
$config = MediaWikiServices::getInstance()->getMainConfig();
if ( !$config->get( 'TranslateGroupSynchronizationCache' ) ) {
return;
Method checkInput
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkInput(): Status {
$status = Status::newGood();
$msgGroup = MessageGroups::getGroup( $this->groupId );
if ( $msgGroup === null ) {
Similar blocks of code found in 2 locations. Consider refactoring. Open
var d01 = Math.sqrt(Math.pow(current.x - previous.x, 2) + Math.pow(current.y - previous.y, 2));
- 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 61.
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 d12 = Math.sqrt(Math.pow(next.x - current.x, 2) + Math.pow(next.y - current.y, 2));
- 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 61.
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
function yRange(mouseY) {
var vm = this._view;
return vm ? (Math.abs(mouseY - vm.y) < vm.radius + vm.hitRadius) : false;
}
- 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 61.
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
function xRange(mouseX) {
var vm = this._view;
return vm ? (Math.abs(mouseX - vm.x) < vm.radius + vm.hitRadius) : false;
}
- 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 61.
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 validateTranslation
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
validateTranslation: function () {
var translateEditor = this,
$textarea = translateEditor.$editor.find( '.tux-textarea-translation' );
var api = new mw.Api();
Function updateElement
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateElement: function(point, index, reset) {
var me = this;
var meta = me.getMeta();
var custom = point.custom || {};
var dataset = me.getDataset();
Function useULS
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function useULS( trigger ) {
const showButton = document.createElement( 'span' );
showButton.classList.add( 'ext-translate-cc-language-selector__trigger' );
Function initCanvas
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initCanvas(canvas, config) {
var style = canvas.style;
// NOTE(SB) canvas.getAttribute('width') !== canvas.width: in the first case it
// returns null or '' if no explicit value has been set to the canvas attribute.
Function getSourceUnits
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getSourceUnits( page ) {
var api = new mw.Api();
return api.get( {
action: 'query',
Function loadMessages
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadMessages() {
var $messageTable = $( '.tux-messagelist' ),
messagegroup = '!sandbox';
$( '<div>' )