Events
17 Mar, 21 - 21 Mar, 10
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Property | Value |
---|---|
Rule ID | CA1509 |
Title | Invalid entry in code metrics configuration file |
Category | Maintainability |
Fix is breaking or non-breaking | Non-Breaking |
Enabled by default in .NET 9 | No |
A configuration file named CodeMetricsConfig.txt has an invalid entry.
The analysis rules for code metrics allow you to supply an additional file in your project named CodeMetricsConfig.txt. This file contains entries to configure code-metric thresholds for analysis. The following rules are configurable in this file:
This configuration file expects each entry to be in following format:
'RuleId'(Optional 'SymbolKind'): 'Threshold'
RuleId
are CA1501
, CA1502
, CA1505
, and CA1506
.SymbolKind
are Assembly
, Namespace
, Type
, Method
, Field
, Event
, and Property
.Threshold
are non-negative integers.For example, the following is a valid configuration file:
# Comment text
CA1501: 1
CA1502(Type): 4
CA1502(Method): 2
An invalid entry in this configuration file is flagged with the CA1509
diagnostic.
To fix a violation of this rule, make sure the invalid entry in CodeMetricsConfig.txt
gets the required format.
Do not suppress violations of this rule.
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Events
17 Mar, 21 - 21 Mar, 10
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register now