Showing 1,238 of 1,238 total issues
Function draw
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
draw: function() {
var ctx = this._chart.ctx;
var vm = this._view;
if (vm.opacity === 0) {
Function roundedRect
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
roundedRect: function(ctx, x, y, width, height, radius) {
if (radius) {
var r = Math.min(radius, height / 2, width / 2);
var left = x + r;
var top = y + r;
Function onShowTranslationMemorySources
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
onShowTranslationMemorySources: function ( e, suggestion ) {
e.stopPropagation();
if ( suggestion.$sourcesElement ) {
suggestion.$sourcesElement.toggleClass( 'hide' );
Function eventHandler
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
eventHandler: function(e) {
var me = this;
var tooltip = me.tooltip;
if (core_plugins.notify(me, 'beforeEvent', [e]) === false) {
Method showTitles
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function showTitles( array $messageGroupsIds ): string {
if ( count( $messageGroupsIds ) >= 100 ) {
return $this->msg( 'tpt-manage-message-group-subscriptions-too-many' )->parse();
}
Method execute
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$dbw = $this->getDB( DB_PRIMARY );
if ( !$dbw->tableExists( 'revtag', __METHOD__ ) ) {
$this->fatalError( "Table revtag doesn't exist. Translate extension is not installed?" );
Method translatablePageHeader
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function translatablePageHeader( $article, &$outputDone, &$pcache ) {
if ( $article->getOldID() ) {
return;
}
Method isValid
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function isValid(): bool {
static $jobHasBeenScheduled = false;
if ( !$this->isMessageNamespace() ) {
return false;
Method getNewTitle
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getNewTitle( Title $title ): Title {
$instructions = $this->map[$title->getNamespace()] ?? null;
if ( $instructions === null ) {
throw new InvalidPageTitleRename(
'Trying to move a page which is not part of the translatable page', self::UNKNOWN_PAGE
Method handleModificationsSubmit
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function handleModificationsSubmit(
MessageGroup $group,
MessageSourceChange $sourceChanges,
WebRequest $req,
string $language,
Method populateQueries
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function populateQueries(): void {
$definition = $this->dataProvider->getDefinition();
$translations = $this->dataProvider->getGoodTranslations();
$sourceLanguage = $this->group->getSourceLanguage();
$targetLanguage = $this->handle->getCode();
Method markAsResolved
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function markAsResolved( string $groupId, ?string $messageTitle = null ): void {
if ( $messageTitle === null ) {
$currentGroupStatus = $this->groupSyncCache->markGroupAsResolved( $groupId );
$this->groupSyncLog->info(
'{user} resolved group {groupId}.',
Method inLanguage
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function inLanguage( string $code ): array {
$dbr = $this->loadBalancer->getConnection( DB_REPLICA, 'vslow' );
$res = $dbr->newSelectQueryBuilder()
->select( [
Method getAllowedParams
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getAllowedParams(): array {
return [
'groupId' => [
ParamValidator::PARAM_TYPE => 'string',
ParamValidator::PARAM_REQUIRED => true,
Method isTranslatableMessage
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function isTranslatableMessage( MessageHandle $handle, string $targetLanguage ): bool {
static $cache = [];
if ( !$handle->isValid() ) {
return false;
Method writeReal
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeReal( MessageCollection $collection ): string {
$header = $this->doHeader( $collection );
$header .= $this->doAuthors( $collection );
$header .= "\n";
Method writeReal
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeReal( MessageCollection $collection ): string {
$output = '';
$mangler = $this->group->getMangler();
/** @var Message $m */
Method writeReal
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeReal( MessageCollection $collection ): string {
$output = $this->doHeader( $collection );
$output .= $this->doAuthors( $collection );
$mangler = $this->group->getMangler();
Similar blocks of code found in 4 locations. Consider refactoring. Open
$specialPageAliases['gsw'] = [
'ImportTranslations' => [ 'Übersetzige_importiere' ],
'LanguageStats' => [ 'Sprochstatischtik' ],
'ManageMessageGroups' => [ 'Noochrichtegruppe_verwalte' ],
'MessageGroupStats' => [ 'Noochrichtegruppestatistike' ],
- 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 102.
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 4 locations. Consider refactoring. Open
$specialPageAliases['scn'] = [
'AggregateGroups' => [ 'GruppiAggregati' ],
'ImportTranslations' => [ 'ImportaTraduzioni' ],
'LanguageStats' => [ 'StatisticheLingua' ],
'ManageMessageGroups' => [ 'GestisciGruppiMessaggio' ],
- 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 102.
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