Subpages
Code analysis
Basic code analysis for Module:Sandbox/Aidan9382 | |
---|---|
Scope | Message |
Scope starting line 4 | data is defined but never referenced
|
Unknown | Return value of require("Module:No globals") was ignored
|
Test invokes
Lua error in package.lua at line 80: module 'Module:No globals' not found.
Lua error in package.lua at line 80: module 'Module:No globals' not found.
parenting Lua error in package.lua at line 80: module 'Module:No globals' not found.
Lua error in package.lua at line 80: module 'Module:No globals' not found.
Lua error in package.lua at line 80: module 'Module:No globals' not found.
Lua error in package.lua at line 80: module 'Module:No globals' not found.
require("Module:No globals")
local functions = {}
function functions.main(data)
return "<div style=text-align:right;font-size:80%>This does nothing as of right now. "..os.time().."</div>"
end
function functions:namecall()
return self
end
local function Dump(t,depth,result,indent,recursion)
local depth = depth or 10
local result = result or ""
local indent = indent or 2
local recursion = recursion or {}
result = result .. "Dump start\n"
for a,b in next,t do
--Indent the table
result = result .. "D"..string.rep(" ",indent)
--Represent the key (we dont expand table keys)
if type(a) == "string" then
result = result .. "\""..a.."\""
else
result = result .. tostring(a)
end
result = result .. ": "
--Represent the value
if type(b) == "string" then
result = result .. "\""..b.."\""
elseif type(b) == "table" then
if depth == 0 then
result = result .. tostring(b) .. "[ Depth limit ]"
elseif recursion[b] then
result = result .. tostring(b) .. "[ Recursion ]"
else --Dump the table inside
recursion[b] = true
result = result .. Dump(b,depth-1,"",indent+2,recursion)
end
elseif type(b) == "nil" then
result = result .. "nil"
else
result = result .. tostring(b)
end
--Finalise line
result = result .. "\n"
end
return result
end
function functions:RawInfo()
return "<sytaxhighlight lang=text>\n"..Dump(self,5).."</syntaxhighlight>"
end
return functions