Skip to content

Commit b955a7f

Browse files
committed
2 parents 1f49d1a + cca1f67 commit b955a7f

2 files changed

Lines changed: 110 additions & 2 deletions

File tree

BPARules-contrib.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
[]
1+
[
2+
3+
]

BPARules-standard.json

Lines changed: 107 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,107 @@
1-
[]
1+
[
2+
{
3+
"ID": "DAX_DIVISION_COLUMNS",
4+
"Name": "Avoid division (use DIVIDE function instead)",
5+
"Category": "DAX Expressions",
6+
"Description": "Calculated Columns, Measures or Calculated Tables should not use the division symbol in their expressions (/). Instead, it is advised to always use the DIVIDE(\u003cnumerator\u003e,\u003cdenominator\u003e) function.",
7+
"Severity": 3,
8+
"Scope": "Measure, CalculatedColumn, CalculatedTable",
9+
"Expression": "Expression.Contains(\"/\")",
10+
"Remarks": "This rule may flag false positives, if a slash (/) is used in an object name or in a comment. To fix this, we need access to the tokens from lexing the expression.",
11+
"Source": "standard\\DAX Expressions"
12+
},
13+
{
14+
"ID": "DAX_TODO",
15+
"Name": "Revisit TODO expressions",
16+
"Category": "DAX Expressions",
17+
"Description": "Objects with an expression containing the word \"TODO\" (typically as a comment), should most likely be revisited.",
18+
"Severity": 1,
19+
"Scope": "Measure, Partition, CalculatedColumn, CalculatedTable",
20+
"Expression": "Expression.IndexOf(\"TODO\", StringComparison.OrdinalIgnoreCase) \u003e= 0",
21+
"Source": "standard\\DAX Expressions"
22+
},
23+
{
24+
"ID": "META_AVOID_FLOAT",
25+
"Name": "Do not use floating point data types",
26+
"Category": "Metadata",
27+
"Description": "Floating point datatypes can cause unexpected results when evaluating values close to 0. Use Decimal instead.",
28+
"Severity": 3,
29+
"Scope": "Measure, DataColumn, CalculatedColumn, CalculatedTableColumn",
30+
"Expression": "DataType = \"Double\"",
31+
"FixExpression": "DataType = DataType.Decimal",
32+
"Source": "standard\\Metadata"
33+
},
34+
{
35+
"ID": "META_SUMMARIZE_NONE",
36+
"Name": "Don\u0027t summarize numeric columns",
37+
"Category": "Metadata",
38+
"Description": "Set the SummarizeBy property of all visible numeric columns to \"None\", to avoid unintentional summarization in client tools. Create measures for columns that are supposed to be summarized.",
39+
"Severity": 1,
40+
"Scope": "DataColumn, CalculatedColumn, CalculatedTableColumn",
41+
"Expression": "IsHidden = false and SummarizeBy \u003c\u003e \"None\"",
42+
"FixExpression": "SummarizeBy = AggregateFunction.None",
43+
"Source": "standard\\Metadata"
44+
},
45+
{
46+
"ID": "LAYOUT_ADD_TO_PERSPECTIVES",
47+
"Name": "Add objects to perspectives",
48+
"Category": "Model Layout",
49+
"Description": "Visible tables, columns, measures and hierarchies should be assigned to at least one perspective, if the Tabular Model uses perspectives. Otherwise, the objects will only be visible when connecting directly to the model.",
50+
"Severity": 1,
51+
"Scope": "Table, Measure, Hierarchy, DataColumn, CalculatedColumn, CalculatedTableColumn",
52+
"Expression": "Model.Perspectives.Any() and not IsHidden and not InPerspective.Any(it)",
53+
"Source": "standard\\Model Layout"
54+
},
55+
{
56+
"ID": "LAYOUT_COLUMNS_HIERARCHIES_DF",
57+
"Name": "Organize columns and hierarchies in display folders",
58+
"Category": "Model Layout",
59+
"Description": "Tables with more than 10 visible columns and/or hierarchies should have them organized in display folders for improved usability.",
60+
"Severity": 1,
61+
"Scope": "Table",
62+
"Expression": "not IsHidden and \n (Columns.Count(not IsHidden and string.IsNullOrEmpty(DisplayFolder)) +\n Hierarchies.Count(not IsHidden and string.IsNullOrEmpty(DisplayFolder))\n) \u003e 10",
63+
"Source": "standard\\Model Layout"
64+
},
65+
{
66+
"ID": "LAYOUT_HIDE_FK_COLUMNS",
67+
"Name": "Hide foreign key columns",
68+
"Category": "Model Layout",
69+
"Description": "Columns used on the Many side of a relationship should be hidden, as the related (dimension) table is likely the best place to apply a filter context.",
70+
"Severity": 1,
71+
"Scope": "DataColumn, CalculatedColumn, CalculatedTableColumn",
72+
"Expression": "Model.Relationships.Any(FromColumn = outerIt) and not IsHidden and not Table.IsHidden",
73+
"FixExpression": "IsHidden = true",
74+
"Source": "standard\\Model Layout"
75+
},
76+
{
77+
"ID": "LAYOUT_LOCALIZE_DF",
78+
"Name": "Translate Display Folders",
79+
"Category": "Model Layout",
80+
"Description": "Display Folder translations should be assigned for objects where the base DisplayFolder property has been assigned. Otherwise, users connecting to the model using a specific Culture will not see the Display Folder structure.",
81+
"Severity": 1,
82+
"Scope": "Measure, Hierarchy, DataColumn, CalculatedColumn, CalculatedTableColumn",
83+
"Expression": "Model.Cultures.Any() and not IsHidden and DisplayFolder \u003c\u003e \"\"",
84+
"FixExpression": "TranslatedDisplayFolder.Reset()",
85+
"Source": "standard\\Model Layout"
86+
},
87+
{
88+
"ID": "LAYOUT_MEASURES_DF",
89+
"Name": "Organize measures in display folders",
90+
"Category": "Model Layout",
91+
"Description": "Tables with more than 10 visible measures should have them organized in display folders for improved usability",
92+
"Severity": 1,
93+
"Scope": "Table",
94+
"Expression": "not IsHidden and Measures.Count(not IsHidden and string.IsNullOrEmpty(DisplayFolder)) \u003e 10",
95+
"Source": "standard\\Model Layout"
96+
},
97+
{
98+
"ID": "PERF_UNUSED_COLUMNS",
99+
"Name": "Remove unused columns",
100+
"Category": "Performance",
101+
"Description": "Hidden columns, which do not have any dependencies, are not used in any relationships, not used in any hierarchies and not used as the SortByColumn for other columns, will likely not be used by clients and thus take up unnecessary space. Consider removing the columns from the model to save space and improve processing time, if you are certain that no external DAX or MDX queries make use of the columns.",
102+
"Severity": 2,
103+
"Scope": "DataColumn, CalculatedColumn, CalculatedTableColumn",
104+
"Expression": "IsHidden = true and\nDependants.Count = 0 and\nnot UsedInRelationships.Any() and\nnot UsedInHierarchies.Any() and\nnot UsedInSortBy.Any()",
105+
"Source": "standard\\Performance"
106+
}
107+
]

0 commit comments

Comments
 (0)