Showing 1,238 of 1,238 total issues
Method write
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function write( MessageCollection $collection ): void {
$writePath = $this->writePath;
if ( $writePath === null ) {
throw new LogicException( 'Write path is not set. Set write path before calling write()' );
Similar blocks of code found in 2 locations. Consider refactoring. Open
this.messageLabel = new OO.ui.MenuOptionWidget( {
label: mw.msg( 'translate-tes-optgroup-message' ),
disabled: true,
highlightable: false,
pressable: 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 59.
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
autosize.update = function ( el ) {
if ( el ) {
Array.prototype.forEach.call( el.length ? el : [ el ], update );
}
return el;
- 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 59.
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 getIssues
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getIssues( Message $message, string $targetLanguage ): ValidationIssues {
$issues = new ValidationIssues();
$definition = $message->definition();
$translation = $message->translation();
Similar blocks of code found in 2 locations. Consider refactoring. Open
this.groupLabel = new OO.ui.MenuOptionWidget( {
label: mw.msg( 'translate-tes-optgroup-group' ),
disabled: true,
highlightable: false,
pressable: 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 59.
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
autosize.destroy = function ( el ) {
if ( el ) {
Array.prototype.forEach.call( el.length ? el : [ el ], destroy );
}
return el;
- 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 59.
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 update
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
update: function(reset) {
var me = this;
var meta = me.getMeta();
var line = meta.dataset;
var points = meta.data || [];
Function getAxesLabelsAndData
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getAxesLabelsAndData( jsonGraphData ) {
var labels = [], graphData = [],
labelIndex = 0,
maxValue = 0, minValue = 0;
Function listen
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
listen: function () {
var messageTable = this,
$filterInput = this.$container.parent().find( '.tux-message-filter-box' );
// Vector has transitions of 250ms which affect layout. Let those finish.
Function init
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function () {
var that = this;
this.render();
Function showAssistantLanguages
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
showAssistantLanguages: function ( translations ) {
if ( translations.error ) {
return;
}
Function listenArrayEvents
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function listenArrayEvents(array, listener) {
if (array._chartjs) {
array._chartjs.listeners.push(listener);
return;
}
Function getFuzzyTimestamp
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getFuzzyTimestamp( pageTitle ) {
var api = new mw.Api();
// This api call returns the timestamp of FuzzyBot's edit
return api.get( {
Method __construct
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct() {
parent::__construct();
$this->addDescription( 'Script to bootstrap TtmServer.' );
$this->addOption(
'threads',
Method execute
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$mwLanguages = $this->loadMediaWiki();
$gtLanguages = $this->loadGettext();
$clLanguages = $this->loadCLDR();
Function calculateTickRotation
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
calculateTickRotation: function() {
var me = this;
var options = me.options;
var tickOpts = options.ticks;
var numTicks = me.getTicks().length;
Method needsFuzzy
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function needsFuzzy( string $text ): bool {
// Docs are exempt for checks
if ( $this->isDoc() ) {
return false;
}
Method getCommonFormFields
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getCommonFormFields(): array {
$dropdownOptions = $this->msg( 'deletereason-dropdown' )->inContentLanguage()->text();
$options = Xml::listDropdownOptions(
$dropdownOptions,
Method getQuery
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getQuery( string $text, string $sourceLanguage, string $targetLanguage ): TranslationQuery {
if ( !isset( $this->config['key'] ) ) {
throw new TranslationWebServiceConfigurationException( 'key is not set' );
}
Method execute
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute( $par ) {
$this->setHeaders();
$this->outputHeader();
$out = $this->getOutput();