[prev in list] [next in list] [prev in thread] [next in thread] 

List:       maven-dev
Subject:    [jira] [Updated] (MCHECKSTYLE-365) Site Report, Rules: Violation count incorrect for duplicate rules
From:       "Robert Turner (JIRA)" <jira () apache ! org>
Date:       2018-12-31 23:49:00
Message-ID: JIRA.13207072.1546285981000.28952.1546300140135 () Atlassian ! JIRA
[Download RAW message or body]


     [ https://issues.apache.org/jira/browse/MCHECKSTYLE-365?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel \
]

Robert Turner updated MCHECKSTYLE-365:
--------------------------------------
    Description: 
When the site report is generated, in the Rules section, the plug-in groups together \
the violation counts for rules that have the same name and message, but that have \
different severity levels -- specifically where one of the rules doesn't specify a \
severity level and uses the default ({{error}}). This results in both rules being \
listed with different properties and severity levels, but with the same violation \
count (which is incorrect).

Also note that adding a unique {{id}} attribute to each of the rules also does not \
result in the violation counts being aggregated correctly. (the proposed patch does \
not address this aspect).

To be correct, the report should use the same criteria for determining unique rules \
as it does for aggregating the violation counts for each rule.

A simple user work-around for some rules (such as {{RegexpSingleline}}) is to change \
the {{message}} property  for each of the rules with different severity levels. \
However, this doesn't work for other rules, such as {{FileTabCharacter}} as the \
{{message}} property is not supported for that rule.

I will attach a screenshot of the issue manifesting itself, and I will provide a pull \
request for the changes to correct the issue.

Sample rule set showing the issue:
{code:xml}
    <module name="FileTabCharacter">
        <property name="id" value="TabCharactersInJavaAndXmlFiles"/>
        <property name="eachLine" value="true"/>
        <property name="fileExtensions" value="java,xml"/> <!-- excludes .properties \
files, also see general fileExtensions property above -->  </module>
    <module name="FileTabCharacter">
        <property name="id" value="TabCharactersInPropertiesFiles"/>
        <property name="eachLine" value="true"/>
        <property name="fileExtensions" value="properties"/>
        <property name="severity" value="info"/> <!-- only make this an information \
message for properties files as it may not be an issue -->  </module>
{code}

  was:
When the site report is generated, in the Rules section, the plug-in groups together \
the violation counts for rules that have the same name and message, but that have \
different severity levels -- specifically where one of the rules doesn't specify a \
severity level and uses the default ({{error}}). This results in both rules being \
listed with different properties and severity levels, but with the same violation \
count (which is incorrect).

Also note that adding a unique {{id}} attribute to each of the rules also does not \
result in the violation counts being aggregated correctly. (the proposed patch does \
not address this aspect).

To be correct, the report should use the same criteria for determining unique rules \
as it does for aggregating the violation counts for each rule.

A simple user work-around for some rules (such as {{RegexpSingleline}}) is to change \
the {{message}} property  for each of the rules with different severity levels. \
However, this doesn't work for other rules, such as {{FileTabCharacter}} as the \
{{message}} property is not supported for that rule.

I will attach a screenshot of the issue manifesting itself, and I will attach a \
proposed patch (which I can convert into a PR if the maintainers deem this to be the \
right approach to solving this issue).

Sample rule set showing the issue:
{code:xml}
    <module name="FileTabCharacter">
        <property name="id" value="TabCharactersInJavaAndXmlFiles"/>
        <property name="eachLine" value="true"/>
        <property name="fileExtensions" value="java,xml"/> <!-- excludes .properties \
files, also see general fileExtensions property above -->  </module>
    <module name="FileTabCharacter">
        <property name="id" value="TabCharactersInPropertiesFiles"/>
        <property name="eachLine" value="true"/>
        <property name="fileExtensions" value="properties"/>
        <property name="severity" value="info"/> <!-- only make this an information \
message for properties files as it may not be an issue -->  </module>
{code}


> Site Report, Rules: Violation count incorrect for duplicate rules when one uses \
>                 default severity
> ------------------------------------------------------------------------------------------------
>  
> Key: MCHECKSTYLE-365
> URL: https://issues.apache.org/jira/browse/MCHECKSTYLE-365
> Project: Maven Checkstyle Plugin
> Issue Type: Bug
> Affects Versions: 3.0.0
> Reporter: Robert Turner
> Priority: Trivial
> Attachments: Screen Shot 2018-12-31 at 14.43.18.png
> 
> Time Spent: 10m
> Remaining Estimate: 0h
> 
> When the site report is generated, in the Rules section, the plug-in groups \
> together the violation counts for rules that have the same name and message, but \
> that have different severity levels -- specifically where one of the rules doesn't \
> specify a severity level and uses the default ({{error}}). This results in both \
> rules being listed with different properties and severity levels, but with the same \
> violation count (which is incorrect). Also note that adding a unique {{id}} \
> attribute to each of the rules also does not result in the violation counts being \
> aggregated correctly. (the proposed patch does not address this aspect). To be \
> correct, the report should use the same criteria for determining unique rules as it \
> does for aggregating the violation counts for each rule. A simple user work-around \
> for some rules (such as {{RegexpSingleline}}) is to change the {{message}} property \
> for each of the rules with different severity levels. However, this doesn't work \
> for other rules, such as {{FileTabCharacter}} as the {{message}} property is not \
> supported for that rule. I will attach a screenshot of the issue manifesting \
> itself, and I will provide a pull request for the changes to correct the issue. \
> Sample rule set showing the issue: {code:xml}
> <module name="FileTabCharacter">
> <property name="id" value="TabCharactersInJavaAndXmlFiles"/>
> <property name="eachLine" value="true"/>
> <property name="fileExtensions" value="java,xml"/> <!-- excludes .properties files, \
> also see general fileExtensions property above --> </module>
> <module name="FileTabCharacter">
> <property name="id" value="TabCharactersInPropertiesFiles"/>
> <property name="eachLine" value="true"/>
> <property name="fileExtensions" value="properties"/>
> <property name="severity" value="info"/> <!-- only make this an information message \
> for properties files as it may not be an issue --> </module>
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic