Page MenuHomePhabricator

Language statistics pages use wrong base to compute percentages
Closed, ResolvedPublic

Description

See, for instance, the language statisics of expressions - it says in its beginning, there were 494,600 expressions but only about 49,800 English ones.
That is, 10% of all expressions are English expressions. Yet, the bar diagram has 100% next to the English bar.

See also: http://www.omegawiki.org/Meta:Insect_room#Language_statistics_pages_use_wrong_base_to_compute_percentages.


Version: unspecified
Severity: normal
URL: http://www.omegawiki.org/Meta:Insect_room#Language_statistics_pages_use_wrong_base_to_compute_percentages.

Details

Reference
bz65456

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:21 AM
bzimport set Reference to bz65456.
bzimport added a subscriber: Unknown Object (MLST).

Since git/gerrit do not work for me, and I cannot install omegawiki (see abovementioned link) here is a list of changes, just in case someone want to try them out:

diff --git a/includes/specials/SpecialOWStatistics.php b/includes/specials/SpecialOWStatistics.php
index bc5e6d5..01fe441 100644

  • a/includes/specials/SpecialOWStatistics.php

+++ b/includes/specials/SpecialOWStatistics.php
@@ -100,7 +100,7 @@ class SpecialOWStatistics extends SpecialPage {

$max = max ( $nbDMArray ) ;

foreach ($nbDMArray as $lang => $dm) {
  • $tableLang .= $this->addTableRowWithBar( $lang, $dm, $max );

+ $tableLang .= $this->addTableRowWithBar( $lang, $dm, $max , $nbdm );

}
$tableLang .= Html::closeElement( 'table' );

@@ -154,7 +154,7 @@ class SpecialOWStatistics extends SpecialPage {

arsort ( $nbDefArray ) ;
$max = max ( $nbDefArray ) ;
foreach ($nbDefArray as $lang => $def) {
  • $tableLang .= $this->addTableRowWithBar( $lang, $def, $max );

+ $tableLang .= $this->addTableRowWithBar( $lang, $def, $max , $nbDefTot );

}

$tableLang .= Html::closeElement( 'table' );

@@ -206,7 +206,7 @@ class SpecialOWStatistics extends SpecialPage {

arsort ( $nbexpArray ) ;
$max = max ( $nbexpArray ) ;
foreach ($nbexpArray as $lang => $exp) {
  • $tableLang .= $this->addTableRowWithBar( $lang, $exp, $max );

+ $tableLang .= $this->addTableRowWithBar( $lang, $exp, $max , $nbexptot );

}

$tableLang .= Html::closeElement( 'table' );

@@ -259,7 +259,7 @@ class SpecialOWStatistics extends SpecialPage {

arsort ( $nbSyntransArray ) ;
$max = max ( $nbSyntransArray ) ;
foreach ($nbSyntransArray as $lang => $syntrans) {
  • $tableLang .= $this->addTableRowWithBar( $lang, $syntrans, $max );

+ $tableLang .= $this->addTableRowWithBar( $lang, $syntrans, $max , $nbSyntransTot );

}
$tableLang .= Html::closeElement( 'table' );

@@ -361,11 +361,12 @@ class SpecialOWStatistics extends SpecialPage {

    • adds a row in a table with three columns
    • the first column is e.g. the language name
    • the second column is a value
  • * the third column shows a bar according to value/max

+ * the third column shows a bar according to $value/$max
+ * followed by a percent figure based on $value/$total

*/
  • function addTableRowWithBar ( $firstcol, $value, $max ) {

+ function addTableRowWithBar ( $firstcol, $value, $max , $total ) {

$wi = ceil( ( ( $value / $max ) * 500 ) );
  • $per = ceil( ( ( $value / $max ) * 100 ) );

+ $per = ceil( ( ( $value / $total ) * 100 ) );

$row = Html::openElement( 'tr' );
$row .= Html::element( 'td', array(), $firstcol );

(In reply to Purodha Blissenbach from comment #1)

Since git/gerrit do not work for me

You could try http://tools.wmflabs.org/gerrit-patch-uploader/

(In reply to Andre Klapper from comment #2)

(In reply to Purodha Blissenbach from comment #1)

Since git/gerrit do not work for me

You could try http://tools.wmflabs.org/gerrit-patch-uploader/

It does not work either. It asks me to login, then:

Application Connection Error
To use Connected Apps on this site, you must have an account across all projects. When you have an account on all projects, you can try to connect "Gerrit Patch Uploader" again.

Unified login needed, E008

Return to MediaWiki.

Purodha set Security to None.