Skip to content

Address S1168: Empty arrays and collections should be returned instead of null #916

@bart-vmware

Description

@bart-vmware

Address existing violations of Address S1168: Empty arrays and collections should be returned instead of null in the codebase and set severity to Warning in Steeltoe.Debug.ruleset and Steeltoe.Release.ruleset.

To find existing violations, enable the rule (see above) and rebuild src/Steeltoe.All.sln to make them appear in the Output window.

To address the violations, choose from the following on a case-by-case basis:

  • Fix the violation by changing the code to not violate the rule
  • Suppress the violation in code using #pragma warning disable/restore, preceded by a justification comment if not obvious

Related to #941 and #946.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions