|
3 | 3 | * [Supported project types](#supported-project-types)
|
4 | 4 | * [Dependency rules](#dependency-rules)
|
5 | 5 | * [Config inheritance](#config-inheritance)
|
| 6 | +* [Dealing with a high number of dependency issues](#dealing-with-a-high-number-of-dependency-issues) |
6 | 7 | * [Controlling verbosity](#controlling-verbosity)
|
7 | 8 | * [Config XML schema](#config-xml-schema)
|
8 | 9 | * [Config XML schema support in Visual Studio](#config-xml-schema-support-in-visual-studio)
|
@@ -44,7 +45,9 @@ Attribute | Values | Description
|
44 | 45 | **CodeIssueKind** | Info, **Warning**, Error | Dependency violations are reported at this severity level.
|
45 | 46 | **ChildCanDependOnParentImplicitly** | true, **false** | If set to true then all child namespaces can depend on any of their parents without an explicit allowing rule. The recommended value is **true**. (False is default for backward compatibility.)
|
46 | 47 | **InfoImportance** | Low, **Normal**, High | Info messages are reported to MSBuild at this level. This setting and the MSBuild verbosity (/v) swicth together determine whether a message appears on the output or not. See [Controlling verbosity](#controlling-verbosity) for details.
|
47 |
| -**MaxIssueCount** | int (>0), default: **100** | Analysis stops when reaching this number of issues. |
| 48 | +**MaxIssueCount** | int (>0), default: **100** | Analysis stops when reaching this number of dependency issues. |
| 49 | +**MaxIssueCountSeverity** | Info, **Warning**, Error | This is the severity of the issue of reaching MaxIssueCount. |
| 50 | +**AutoLowerMaxIssueCount** | true, **false** | If set to true then each successful build yielding fewer issues than MaxIssueCount sets MaxIssueCount to the current number of issues. |
48 | 51 | **InheritanceDepth** | int (>=0), default: **0** | Sets the number of parent folder levels to inherit config from. 0 means no inheritance.
|
49 | 52 |
|
50 | 53 | ### Whitelisting
|
@@ -164,6 +167,23 @@ Even if all the settings come from a higher-level config, you have to put **at l
|
164 | 167 | E.g.: `<NsDepCopConfig InheritanceDepth="3"/>`
|
165 | 168 | * You can turn on diagnostic messages ([Controlling verbosity](#controlling-verbosity)) to see which config files were found and loaded by the tool and what effective config resulted from combining them.
|
166 | 169 |
|
| 170 | +## Dealing with a high number of dependency issues |
| 171 | +If there are so many dependency issues that you cannot fix them all at once but you still want to control them somehow then try the following. |
| 172 | + |
| 173 | +* Prevent the introduction of more dependency issues. Set the current number of issues as the maximum and make it an error to create more. |
| 174 | + |
| 175 | +```xml |
| 176 | +<NsDepCopConfig IssueKind="Warning" MaxIssueCount="<the current number of issues>" MaxIssueCountSeverity="Error"> |
| 177 | +``` |
| 178 | + |
| 179 | +* Encourage developers to gradually fix the dependency issues by automatically lowering the max issue count whenever possible. Turn on AutoLowerMaxIssueCount. |
| 180 | + |
| 181 | +```xml |
| 182 | +<NsDepCopConfig IssueKind="Warning" MaxIssueCount="100" MaxIssueCountSeverity="Error" AutoLowerMaxIssueCount="true"> |
| 183 | +``` |
| 184 | + |
| 185 | +> Please note that when NsDepCop modifies the nsdepcop.config files their formatting will be reset (because of the XML deserialization/serialization roundtrip). |
| 186 | +
|
167 | 187 | ## Controlling verbosity
|
168 | 188 | * Besides emitting dependency violation issues, the tool can emit diagnostic and info messages too.
|
169 | 189 | * **Info messages** tell you when was the tool started and finished.
|
|
0 commit comments