Tool:PhanSearch

From Wikitech
Toolforge tools
PhanSearch
Website https://phansearch.toolforge.org
Description Tool for MediaWiki developers (and extensions and skins developers) to explore the PHP function calls. It is similar to CodeSearch (explore the MediaWiki codebase) but with a more specific use case, and a different technology stack (this tool uses the static analysis tool Phan instead of a full-text search). To search PHP function calls, there are no false positives compared to CodeSearch, but there could be false negatives.
Keywords codequality, mediawiki, phan, software-development
Author(s) Seb35talk
Maintainer(s) Seb35 (View all)
Source code https://gitlab.wikimedia.org/toolforge-repos/phansearch
License The Unlicense

This tool PhanSearch is still in experimental status as of 2022-12-01.

TODO

français

À faire :

  • [UI] Réécrire l’interface en Svelte
  • [UI] Boutons radio sur les versions
  • [UX] Pouvoir changer de branche en gardant la fonction recherchée (+actualisation)
  • [UI] Ajouter un bouton de recherche explicite à droite
  • [UX] Ajouter le commentaire de la définition de la fonction
  • [backend] Marquer le statut d’une fonction hard/soft-deprecated
  • [backend] Ajouter un booléen "isTest" pour marquer si le fichier considéré est dans /tests
  • [frontend] Pretty URL
  • Publier le code sur Gitlab
  • [UI] Liste des versions au-dessus de la boîte de recherche - fait
  • [UX] Ordonner la liste des fichiers - fait (mais on pourrait faire d’autres classifications extensions/core/skins + prod/tests)
  • [backend] Il manque des fonctions, par ex LinkCache::addGoodLinkObj - fait (cette méthode n’est pas utilisée, probablement car elle est marquée comme hard-deprecated)
  • [backend] Il manque des classes, par ex ApiStashEdit - fait (toutes les méthodes de cette classes sont inutilisées en apparence dans les autres parties de MediaWiki, car cette classe est inscrite comme module d’API et toutes les méthodes sont appelées comme méthodes surchargées de ApiBase)

Remarques :

  • [UX] Diffs entre branches (à creuser sur les use cases)
  • [UX] Afficher en gros le nom de la fonction recherchée dans la définition (question UX à demander à d’autres utilisateurs)

English

TODO:

  • [UI] Rewrite interface with Svelte
  • [UI] Radio buttons on the versions
  • [UX] Be able to change the branch by keeping the searched function (+refresh the associated results)
  • [UI] Add an explicit search button on the right
  • [UX] Add the comment of the definition of the function
  • [backend] Mark the status of a function hard/soft-deprecated
  • [backend] Add a boolean "isTest" to mark if the given file is in /tests
  • [frontend] Pretty URL
  • Publish the code on Gitlab
  • [UI] Put the list of versions above the search box - done
  • [UX] Sort the list of files - done (but other classifications could be added, like core/extensions/skins + prod/tests)
  • [backend] Some methods are missing, like LinkCache::addGoodLinkObj - solved (this method is unused, it can be explained by its hard-deprecated status)
  • [backend] Some classes are missing, like ApiStashEdit - solved (all methods in this class are apparently unused in other areas of MediaWiki, because the class is registered as an API module and all methods are called as overridden methods of ApiBase)

Remarks:

  • [UX] Diffs between branches (more to be studied about possible use cases)
  • [UX] Display with a bigger font the name of the searched function, in the “Definition” section (UX question to ask to other users)