Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inspections Severity Location #1079

Closed
Hosch250 opened this issue Feb 12, 2016 · 3 comments
Closed

Inspections Severity Location #1079

Hosch250 opened this issue Feb 12, 2016 · 3 comments

Comments

@Hosch250
Copy link
Member

The inspections severity needs to become a public field as well as being assigned to the base in each and every inspection. It should look something like this:

public CodeInspectionSeverity Severity { get { CodeInspectionSeverity.Warning; } }
public FunctionReturnValueNotUsedInspection(RubberduckParserState state)
    : base(state, Severity)
{
}

This is very easy, but also very monotonous. You'll need to update the InspectionBase ctor:

protected InspectionBase(RubberduckParserState state, CodeInspectionSeverity severity)
{
    State = state;
    Severity = severity;
}
@Hosch250 Hosch250 added feature-settings up-for-grabs Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky labels Feb 12, 2016
@Hosch250 Hosch250 added this to the Version 2.0 milestone Feb 12, 2016
@retailcoder
Copy link
Member

This can't be right: we need to be able to set this value; I don't see why it couldn't just be an auto-property:

public CodeInspectionSeverity Severity { get; set; }

The constructor would just pass the hard-coded default down to the base constructor:

public FunctionReturnValueNotUsedInspection(RubberduckParserState state)
    : base(state, Severity.Warning)
{
}

Instead of assigning _severity in the same class. The idea is basically to have 2 severity properties: the default, and the current.

@Hosch250
Copy link
Member Author

There is no _severity field in the same class. The current implementation is:

public WriteOnlyPropertyInspection(RubberduckParserState state)
    : base(state)
{
    Severity = CodeInspectionSeverity.Warning;
}

@retailcoder
Copy link
Member

Right, an auto-property.

The base class could have this:

public CodeInspectionSeverity DefaultSeverity { get; private set; }

@Hosch250 Hosch250 assigned Hosch250 and unassigned Hosch250 Feb 12, 2016
@retailcoder retailcoder self-assigned this Feb 14, 2016
@retailcoder retailcoder removed the up-for-grabs Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky label Feb 14, 2016
retailcoder referenced this issue in retailcoder/Rubberduck Feb 14, 2016
…ions; added missing resource strings in InspectionsUI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants