max-statements
Enforce a maximum number of statements in three contexts: function, label and main
INFO
☑️ The predefined configuration "mslint:recommended" enables this rule.
Rule details
This rule limits the number of statements in three contexts: function, label and main.
Settings
maximumfunctionthe maximum number of statements in functions. Default100.labelthe maximum number of statements in labels. Default100.mainthe maximum number of statements in main. Default100.
Example of incorrect code for this rule:
maniascript
/*
{
"maximum" = {
"function" = 2,
"label" = 2,
"main" = 2
}
}
*/
Void Function() {
declare Integer A = 1;
declare Integer B = 2;
// White spaces or comment are not statements
declare Integer C = 3;
}
***Label***
***
declare Integer A = 1;
declare Integer B = 2;
declare Integer C = 3;
***
main() {
declare Integer A = 1;
declare Integer B = 2;
declare Integer C = 3;
}Example of correct code for this rule:
maniascript
/*
{
"maximum" = {
"function" = 2,
"label" = 2,
"main" = 2
}
}
*/
Void Function() {
declare Integer A = 1;
declare Integer B = 2;
}
***Label***
***
declare Integer A = 1;
declare Integer B = 2;
***
main() {
declare Integer A = 1;
declare Integer B = 2;
}