Module:Infobox body of water tracking
Appearance
| This module is rated as ready for general use. It has reached a mature state, is considered relatively stable and bug-free, and may be used wherever appropriate. It can be mentioned on help pages and other Wikipedia resources as an option for new users. To minimise server load and avoid disruptive output, improvements should be developed through sandbox testing rather than repeated trial-and-error editing. |
| This module is currently protected from editing. See the protection policy and protection log for more details. Please discuss any changes on the talk page; you may submit an edit request to ask an administrator to make an edit if it is uncontroversial or supported by consensus. You may also request that this page be unprotected. |
This module is used by Template:Infobox body of water.
Usage
{{#invoke:Infobox body of water tracking|tracking}}
Tracking/maintenance categories
- Category:Wikipedia infobox body of water articles needing maintenance (3)
- Category:Articles using infobox body of water without coordinates (145)
- Category:Articles using infobox body of water without image (7,477)
- Category:Articles using infobox body of water without alt (9,525)
- Category:Articles using infobox body of water without pushpin_map (1,208)
- Category:Articles using infobox body of water without pushpin_map_alt (10,643)
- Category:Articles using infobox body of water without image_bathymetry (18,289)
- Category:Articles using infobox body of water without alt_bathymetry (488)
- Category:Articles using infobox body of water with mapframe (1,905)
- Category:Pages using infobox body of water with a non-automatically converted dimension (0)
- Category:Pages using infobox body of water with duplicate parameters (1)
- Category:Pages using infobox body of water with unknown parameters (0)
local p = {}
function p.tracking(frame)
function isblank( val )
return (val == nil) or val:match('^[%s]*$')
end
local cats = ''
local args = frame:getParent().args
if (isblank(args['image']) and isblank(args['image_lake']) ) then
cats = cats .. '[[Category:Wikipedia infobox body of water articles without image]]'
end
if isblank(args['coords']) and isblank(args['coordinates']) then
cats = cats .. '[[Category:Wikipedia infobox body of water articles without coordinates]]'
end
local duplicate_parameters = 0
local unknown_parameters = 0
if (args['child'] and args['embed']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['name'] and args['lake_name']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['image'] and args['image_lake']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['alt'] and args['alt_lake']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['caption'] and args['caption_lake']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['coordinates'] and args['coords']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['lake_type'] and args['type']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['ocean_type'] and args['type']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['part_of'] and args['parent']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['basin_countries'] and args['countries']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['catchment_km2'] and args ['catchment']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['length_km'] and args['length']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['width_km'] and args['width']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['area_km2'] and args['area']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['depth_m'] and args['depth']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['max-depth_m'] and args['max-depth']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['volume_km3'] and args['volume']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['shore_km'] and args['shore']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['elevation_m'] and args['elevation']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['settlements'] and args['cities']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['extra'] and args['nrhp']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['extra'] and args['embedded']) then
duplicate_parameters = duplicate_parameters + 1
end
if (duplicate_parameters > 0) then
cats = cats .. '[[Category:Wikipedia infobox body of water articles using duplicate parameters]]'
end
local deprecated_parameters = 0
if (args['catchment'] or ''):match('^[%s]*[0-9][ 0-9,%.]*$') then
deprecated_parameters = deprecated_parameters + 1
end
if (args['length'] or ''):match('^[%s]*[0-9][ 0-9,%.]*$') then
deprecated_parameters = deprecated_parameters + 1
end
if (args['width'] or ''):match('^[%s]*[0-9][ 0-9,%.]*$') then
deprecated_parameters = deprecated_parameters + 1
end
if (args['area'] or ''):match('^[%s]*[0-9][ 0-9,%.]*$') then
deprecated_parameters = deprecated_parameters + 1
end
if (args['depth'] or ''):match('^[%s]*[0-9][ 0-9,%.]*$') then
deprecated_parameters = deprecated_parameters + 1
end
if (args['max-depth'] or ''):match('^[%s]*[0-9][ 0-9,%.]*$') then
deprecated_parameters = deprecated_parameters + 1
end
if (args['volume'] or ''):match('^[%s]*[0-9][ 0-9,%.]*$') then
deprecated_parameters = deprecated_parameters + 1
end
if (args['shore'] or ''):match('^[%s]*[0-9][ 0-9,%.]*$') then
deprecated_parameters = deprecated_parameters + 1
end
if (args['elevation'] or ''):match('^[%s]*[0-9][ 0-9,%.]*$') then
deprecated_parameters = deprecated_parameters + 1
end
if (args['elevation_ref'] or ''):match('^[%s]*[A-Z%-]+[^%s]*$') then
unknown_parameters = unknown_parameters + 1
end
if (deprecated_parameters > 0) then
cats = cats .. '[[Category:Wikipedia infobox body of water articles using deprecated parameters]]'
end
if (unknown_parameters > 0) then
cats = cats .. '[[Category:Pages using infobox body of water with unknown parameters]]'
end
return cats
end
return p