Jump to content

Module:Sandbox/Aidan9382/CodeAnalysis/doc: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Initial docs
 
testing invoke stuff (ignore the errors emitting for now)
Line 1: Line 1:
{{Module rating|beta}}
{{Module rating|beta}}


== Usage ==
This module is to be required and used from the Debug console, like the following: <syntaxhighlight lang=lua inline>require("Module:Sandbox/Aidan9382/CodeAnalysis")()</syntaxhighlight>. The module will then note any unused locals or any global references. <!--More to come soon? who knows-->

This module is to be required and used from the Debug console, like the following: <syntaxhighlight lang=lua inline>require("Module:Sandbox/Aidan9382/CodeAnalysis").run()</syntaxhighlight>. The module will then note any unused locals or any global references. <!--More to come soon? who knows-->


The function can be provided an argument to specify a target page other than the current page. Valid inputs are the name of the wanted page as a string, or the mw.title object of the wanted page.
The function can be provided an argument to specify a target page other than the current page. Valid inputs are the name of the wanted page as a string, or the mw.title object of the wanted page.


The code of this is mostly lifted from https://github.com/9382/Dump/tree/main/LuaObfuscator, which in turn lifts a lot of code from https://github.com/stravant/LuaMinify.
The code of this is mostly lifted from https://github.com/9382/Dump/tree/main/LuaObfuscator, which in turn lifts a lot of code from https://github.com/stravant/LuaMinify.

== Examples ==
{{#invoke:Module:Sandbox/Aidan9382/CodeAnalysis|main}}

{{#invoke:Module:Sandbox/Aidan9382/CodeAnalysis|main|Module:Wikitext Parsing}}


<includeonly>{{Sandbox other||
<includeonly>{{Sandbox other||

Revision as of 11:18, 12 May 2023


Usage

This module is to be required and used from the Debug console, like the following: require("Module:Sandbox/Aidan9382/CodeAnalysis").run(). The module will then note any unused locals or any global references.

The function can be provided an argument to specify a target page other than the current page. Valid inputs are the name of the wanted page as a string, or the mw.title object of the wanted page.

The code of this is mostly lifted from https://github.com/9382/Dump/tree/main/LuaObfuscator, which in turn lifts a lot of code from https://github.com/stravant/LuaMinify.

Examples

Script error: No such module "Module:Sandbox/Aidan9382/CodeAnalysis".

Script error: No such module "Module:Sandbox/Aidan9382/CodeAnalysis".