Find TODO anywhere in the model in BPA rules #900
Unanswered
edhans
asked this question in
🙋♀️TE3 Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to create rules where if I put TODO pretty much anywhere in the model, it will show up in BPA. Exampes:
I have 3 rules currently:
{
"ID": "NEW_RULE",
"Name": "[CRITICAL] Revisit TODO expressions in tables",
"Category": "DAX Expressions",
"Description": "Objects with an expression containing the word "TODO" (typically as a comment), should most likely be revisited.",
"Severity": 4,
"Scope": "Table, DataColumn, CalculationGroup",
"Expression": "Description.IndexOf("TODO", StringComparison.OrdinalIgnoreCase) >= 0 ",
"FixExpression": null,
"CompatibilityLevel": 1200,
"ObjectCount": 8,
"ErrorMessage": null
},
{
"ID": "NEW_RULE_1",
"Name": "[CRITICAL] Revisit TODO expressions",
"Category": "DAX Expressions",
"Description": "Objects with an expression containing the word "TODO" (typically as a comment), should most likely be revisited.",
"Severity": 3,
"Scope": "Measure, CalculatedColumn, CalculatedTable, CalculationItem",
"Expression": "Expression.IndexOf("TODO", StringComparison.OrdinalIgnoreCase) >= 0 or\r\nDescription.IndexOf("TODO", StringComparison.OrdinalIgnoreCase) >= 0 ",
"FixExpression": null,
"CompatibilityLevel": 1200,
"ObjectCount": 3,
"ErrorMessage": null
},
{
"ID": "NEW_RULE_2",
"Name": "[CRITICAL] Revisit TODO expressions in partitions",
"Category": "DAX Expressions",
"Description": "Objects with an expression containing the word "TODO" (typically as a comment), should most likely be revisited.",
"Severity": 4,
"Scope": "Partition",
"Expression": "Expression.IndexOf("TODO", StringComparison.OrdinalIgnoreCase) >= 0",
"FixExpression": null,
"CompatibilityLevel": 1560,
"ObjectCount": 1,
"ErrorMessage": null
}
NEW_RULE handles descriptions in tables, fields, and CG's.
NEW_RULE_1 is basic dax. Works great.
NEW_RULE_2 is the new one, and it has problems.
It only works on M code in partitions. I cannot get it to work on Shared Expressions. But even worse, if it is active, NEW_RULE stops working. I cannot figure out what the conflict is, but it is blocking NEW_RULE. As soon as I disable it, NEW_RULE starts to work again.
Any assistance, or maybe 1-2 larger BPA rules that will effectively find any TODO keyword in a Power BI model in the service?
Beta Was this translation helpful? Give feedback.
All reactions