Advisor

Advisor loads, checks, and runs rules for the various mk-*-advisor tools.

Summary
AdvisorAdvisor loads, checks, and runs rules for the various mk-*-advisor tools.
Functions
new
load_rulesLoad rules from the given advisor module.
load_rule_infoLoad rule information (severity and description) from the given advisor module.
run_rulesRun all rules from all advisors loaded ealier.
get_rule_infoGet the information for a rule by ID.
_d

Functions

new

sub new

Parameters

%argsArguments

Required Arguments

match_typeHow rules match: “bool” or “pos”
ignore_rulesHashref with rule IDs to ignore

Returns

Advisor object

load_rules

sub load_rules

Load rules from the given advisor module.  Will die on duplicate rule IDs.

Parameters

$advisorAn *AdvisorRules module, like QueryAdvisorRules

load_rule_info

sub load_rule_info

Load rule information (severity and description) from the given advisor module.

Parameters

$advisorAn *AdvisorRules module, like QueryAdvisorRules

run_rules

sub run_rules

Run all rules from all advisors loaded ealier.

Parameters

%argsArguments passed through to each rule’s coderef

Returns

An arrayref of rule IDs that matched and arrayref of pos where those rules matched (if new() match_type is “bool”).

get_rule_info

sub get_rule_info

Get the information for a rule by ID.

Parameters

$idRule ID

Returns

Hashref with the rule’s information (id, severity, description)

_d

sub _d
sub new
sub load_rules
Load rules from the given advisor module.
sub load_rule_info
Load rule information (severity and description) from the given advisor module.
sub run_rules
Run all rules from all advisors loaded ealier.
sub get_rule_info
Get the information for a rule by ID.
sub _d
QueryAdvisorRules encapsulates rules for checking queries.
Close