Last modified: 2014-05-22 11:06:14 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T67456, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 65456 - Language statistics pages use wrong base to compute percentages
Language statistics pages use wrong base to compute percentages
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
WikiLexicalData/OmegaWiki (Other open bugs)
unspecified
All All
: Unprioritized normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
http://www.omegawiki.org/Meta:Insect_...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-18 13:39 UTC by Purodha Blissenbach
Modified: 2014-05-22 11:06 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Purodha Blissenbach 2014-05-18 13:39:25 UTC
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.
Comment 1 Purodha Blissenbach 2014-05-18 23:58:22 UTC
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 );
Comment 2 Andre Klapper 2014-05-19 09:19:11 UTC
(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/
Comment 3 Purodha Blissenbach 2014-05-22 11:06:14 UTC
(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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links