Quantcast

Rule can not use 'Constant/issue' remediation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
25 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Rule can not use 'Constant/issue' remediation

Jorge Costa
Hi sonar devs,

Can someone explain what this means:

Caused by: java.lang.IllegalArgumentException: Rule 'cxx:CycleBetweenPackages' can not use 'Constant/issue' remediation
function because this rule does not have a fixed remediation cost.
        at org.sonar.batch.issue.ModuleIssues.calculateDebt(ModuleIssues.java:133)
        at org.sonar.batch.issue.ModuleIssues.updateIssue(ModuleIssues.java:127)
        at org.sonar.batch.issue.ModuleIssues.initAndAddIssue(ModuleIssues.java:96)
        at org.sonar.batch.issue.ModuleIssues.initAndAddIssue(ModuleIssues.java:66)
        at org.sonar.batch.issue.DefaultIssuable.addIssue(DefaultIssuable.java:56)
        at org.sonar.plugins.cxx.squid.DependencyAnalyzer.saveViolations(DependencyAnalyzer.java:225)
        at org.sonar.plugins.cxx.squid.DependencyAnalyzer.save(DependencyAnalyzer.java:165)
        at org.sonar.plugins.cxx.squid.CxxSquidSensor.save(CxxSquidSensor.java:196)
        at org.sonar.plugins.cxx.squid.CxxSquidSensor.analyse(CxxSquidSensor.java:129)
        at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:79)
        at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:70)
        at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:119)
        at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:194)
        at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
        at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
        at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:233)
        at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:228)
        at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:221)
        at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
        at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
        at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:64)
        at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:51)
        at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:125)
        at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)

For this kind of rule specification:
@Rule(
  key = "CycleBetweenPackages",
  name = "Avoid cyclic dependency between packages",
  tags = {Tags.CONVENTION},
  priority = Priority.MAJOR)
@ActivatedByDefault
@SqaleSubCharacteristic(RulesDefinition.SubCharacteristics.ARCHITECTURE_RELIABILITY)
@SqaleConstantRemediation("5min")
public class CycleBetweenPackagesCheck extends SquidCheck<Grammar> {

This occurs in sonar 5.1

Thanks in advance
Best Regards
Jorge Costa
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Rule can not use 'Constant/issue' remediation

Julien Lancelot
Hi Jorge,

You're facing an issue that was introduced in SonarQube 4.3 when we migrate the technical debt definitions from the characteristics to the rules table.
You need to reset your technical debt definitions by following the instructions described in this comment : https://jira.codehaus.org/browse/SONAR-5056?focusedCommentId=366679&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-366679

Regards,

Julien LANCELOT | SonarSource

On 5 May 2015 at 18:29, Jorge Costa <[hidden email]> wrote:
Hi sonar devs,

Can someone explain what this means:

Caused by: java.lang.IllegalArgumentException: Rule
'cxx:CycleBetweenPackages' can not use 'Constant/issue' remediation
function because this rule does not have a fixed remediation cost.
        at
org.sonar.batch.issue.ModuleIssues.calculateDebt(ModuleIssues.java:133)
        at
org.sonar.batch.issue.ModuleIssues.updateIssue(ModuleIssues.java:127)
        at
org.sonar.batch.issue.ModuleIssues.initAndAddIssue(ModuleIssues.java:96)
        at
org.sonar.batch.issue.ModuleIssues.initAndAddIssue(ModuleIssues.java:66)
        at
org.sonar.batch.issue.DefaultIssuable.addIssue(DefaultIssuable.java:56)
        at
org.sonar.plugins.cxx.squid.DependencyAnalyzer.saveViolations(DependencyAnalyzer.java:225)
        at
org.sonar.plugins.cxx.squid.DependencyAnalyzer.save(DependencyAnalyzer.java:165)
        at
org.sonar.plugins.cxx.squid.CxxSquidSensor.save(CxxSquidSensor.java:196)
        at
org.sonar.plugins.cxx.squid.CxxSquidSensor.analyse(CxxSquidSensor.java:129)
        at
org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:79)
        at
org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:70)
        at
org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:119)
        at
org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:194)
        at
org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
        at
org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
        at
org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:233)
        at
org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:228)
        at
org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:221)
        at
org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
        at
org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
        at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:64)
        at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:51)
        at
org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:125)
        at
org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)

For this kind of rule specification:
@Rule(
  key = "CycleBetweenPackages",
  name = "Avoid cyclic dependency between packages",
  tags = {Tags.CONVENTION},
  priority = Priority.MAJOR)
@ActivatedByDefault
@SqaleSubCharacteristic(RulesDefinition.SubCharacteristics.ARCHITECTURE_RELIABILITY)
@SqaleConstantRemediation("5min")
public class CycleBetweenPackagesCheck extends SquidCheck<Grammar> {

This occurs in sonar 5.1

Thanks in advance




-----
Best Regards
Jorge Costa
--
View this message in context: http://sonarqube.15.x6.nabble.com/Rule-can-not-use-Constant-issue-remediation-tp5035013.html
Sent from the SonarQube Developers mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Rule can not use 'Constant/issue' remediation

Jorge Costa

Hi Julien

Thank you very much for the solution . I will add additional comments to the item if need


On Wed, May 6, 2015, 10:13 Julien Lancelot <[hidden email]> wrote:
Hi Jorge,

You're facing an issue that was introduced in SonarQube 4.3 when we migrate the technical debt definitions from the characteristics to the rules table.
You need to reset your technical debt definitions by following the instructions described in this comment : https://jira.codehaus.org/browse/SONAR-5056?focusedCommentId=366679&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-366679

Regards,

Julien LANCELOT | SonarSource

On 5 May 2015 at 18:29, Jorge Costa <[hidden email]> wrote:
Hi sonar devs,

Can someone explain what this means:

Caused by: java.lang.IllegalArgumentException: Rule
'cxx:CycleBetweenPackages' can not use 'Constant/issue' remediation
function because this rule does not have a fixed remediation cost.
        at
org.sonar.batch.issue.ModuleIssues.calculateDebt(ModuleIssues.java:133)
        at
org.sonar.batch.issue.ModuleIssues.updateIssue(ModuleIssues.java:127)
        at
org.sonar.batch.issue.ModuleIssues.initAndAddIssue(ModuleIssues.java:96)
        at
org.sonar.batch.issue.ModuleIssues.initAndAddIssue(ModuleIssues.java:66)
        at
org.sonar.batch.issue.DefaultIssuable.addIssue(DefaultIssuable.java:56)
        at
org.sonar.plugins.cxx.squid.DependencyAnalyzer.saveViolations(DependencyAnalyzer.java:225)
        at
org.sonar.plugins.cxx.squid.DependencyAnalyzer.save(DependencyAnalyzer.java:165)
        at
org.sonar.plugins.cxx.squid.CxxSquidSensor.save(CxxSquidSensor.java:196)
        at
org.sonar.plugins.cxx.squid.CxxSquidSensor.analyse(CxxSquidSensor.java:129)
        at
org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:79)
        at
org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:70)
        at
org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:119)
        at
org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:194)
        at
org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
        at
org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
        at
org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:233)
        at
org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:228)
        at
org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:221)
        at
org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
        at
org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
        at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:64)
        at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:51)
        at
org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:125)
        at
org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)

For this kind of rule specification:
@Rule(
  key = "CycleBetweenPackages",
  name = "Avoid cyclic dependency between packages",
  tags = {Tags.CONVENTION},
  priority = Priority.MAJOR)
@ActivatedByDefault
@SqaleSubCharacteristic(RulesDefinition.SubCharacteristics.ARCHITECTURE_RELIABILITY)
@SqaleConstantRemediation("5min")
public class CycleBetweenPackagesCheck extends SquidCheck<Grammar> {

This occurs in sonar 5.1

Thanks in advance




-----
Best Regards
Jorge Costa
--
View this message in context: http://sonarqube.15.x6.nabble.com/Rule-can-not-use-Constant-issue-remediation-tp5035013.html
Sent from the SonarQube Developers mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Best Regards
Jorge Costa
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Rule can not use 'Constant/issue' remediation

Julien Lancelot
Hi Jorge,

Please keep me updated if your issue is fixed. 
And please send any comments on this thread and not in the JIRA ticket.

Thanks.
Regards,

Julien LANCELOT | SonarSource

On 6 May 2015 at 15:34, Jorge Costa <[hidden email]> wrote:

Hi Julien

Thank you very much for the solution . I will add additional comments to the item if need


On Wed, May 6, 2015, 10:13 Julien Lancelot <[hidden email]> wrote:
Hi Jorge,

You're facing an issue that was introduced in SonarQube 4.3 when we migrate the technical debt definitions from the characteristics to the rules table.
You need to reset your technical debt definitions by following the instructions described in this comment : https://jira.codehaus.org/browse/SONAR-5056?focusedCommentId=366679&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-366679

Regards,

Julien LANCELOT | SonarSource

On 5 May 2015 at 18:29, Jorge Costa <[hidden email]> wrote:
Hi sonar devs,

Can someone explain what this means:

Caused by: java.lang.IllegalArgumentException: Rule
'cxx:CycleBetweenPackages' can not use 'Constant/issue' remediation
function because this rule does not have a fixed remediation cost.
        at
org.sonar.batch.issue.ModuleIssues.calculateDebt(ModuleIssues.java:133)
        at
org.sonar.batch.issue.ModuleIssues.updateIssue(ModuleIssues.java:127)
        at
org.sonar.batch.issue.ModuleIssues.initAndAddIssue(ModuleIssues.java:96)
        at
org.sonar.batch.issue.ModuleIssues.initAndAddIssue(ModuleIssues.java:66)
        at
org.sonar.batch.issue.DefaultIssuable.addIssue(DefaultIssuable.java:56)
        at
org.sonar.plugins.cxx.squid.DependencyAnalyzer.saveViolations(DependencyAnalyzer.java:225)
        at
org.sonar.plugins.cxx.squid.DependencyAnalyzer.save(DependencyAnalyzer.java:165)
        at
org.sonar.plugins.cxx.squid.CxxSquidSensor.save(CxxSquidSensor.java:196)
        at
org.sonar.plugins.cxx.squid.CxxSquidSensor.analyse(CxxSquidSensor.java:129)
        at
org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:79)
        at
org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:70)
        at
org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:119)
        at
org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:194)
        at
org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
        at
org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
        at
org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:233)
        at
org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:228)
        at
org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:221)
        at
org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
        at
org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
        at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:64)
        at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:51)
        at
org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:125)
        at
org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)

For this kind of rule specification:
@Rule(
  key = "CycleBetweenPackages",
  name = "Avoid cyclic dependency between packages",
  tags = {Tags.CONVENTION},
  priority = Priority.MAJOR)
@ActivatedByDefault
@SqaleSubCharacteristic(RulesDefinition.SubCharacteristics.ARCHITECTURE_RELIABILITY)
@SqaleConstantRemediation("5min")
public class CycleBetweenPackagesCheck extends SquidCheck<Grammar> {

This occurs in sonar 5.1

Thanks in advance




-----
Best Regards
Jorge Costa
--
View this message in context: http://sonarqube.15.x6.nabble.com/Rule-can-not-use-Constant-issue-remediation-tp5035013.html
Sent from the SonarQube Developers mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Rule can not use 'Constant/issue' remediation

Jorge Costa

Ok, sorry for the circular talk. On my case, I think i was able to fix it by using the rest api by changing the char to linear and back to constant. I will ask the other user to post is experience in this thread.


On Thu, May 7, 2015, 10:36 Julien Lancelot <[hidden email]> wrote:
Hi Jorge,

Please keep me updated if your issue is fixed. 
And please send any comments on this thread and not in the JIRA ticket.

Thanks.
Regards,

Julien LANCELOT | SonarSource

On 6 May 2015 at 15:34, Jorge Costa <[hidden email]> wrote:

Hi Julien

Thank you very much for the solution . I will add additional comments to the item if need


On Wed, May 6, 2015, 10:13 Julien Lancelot <[hidden email]> wrote:
Hi Jorge,

You're facing an issue that was introduced in SonarQube 4.3 when we migrate the technical debt definitions from the characteristics to the rules table.
You need to reset your technical debt definitions by following the instructions described in this comment : https://jira.codehaus.org/browse/SONAR-5056?focusedCommentId=366679&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-366679

Regards,

Julien LANCELOT | SonarSource

On 5 May 2015 at 18:29, Jorge Costa <[hidden email]> wrote:
Hi sonar devs,

Can someone explain what this means:

Caused by: java.lang.IllegalArgumentException: Rule
'cxx:CycleBetweenPackages' can not use 'Constant/issue' remediation
function because this rule does not have a fixed remediation cost.
        at
org.sonar.batch.issue.ModuleIssues.calculateDebt(ModuleIssues.java:133)
        at
org.sonar.batch.issue.ModuleIssues.updateIssue(ModuleIssues.java:127)
        at
org.sonar.batch.issue.ModuleIssues.initAndAddIssue(ModuleIssues.java:96)
        at
org.sonar.batch.issue.ModuleIssues.initAndAddIssue(ModuleIssues.java:66)
        at
org.sonar.batch.issue.DefaultIssuable.addIssue(DefaultIssuable.java:56)
        at
org.sonar.plugins.cxx.squid.DependencyAnalyzer.saveViolations(DependencyAnalyzer.java:225)
        at
org.sonar.plugins.cxx.squid.DependencyAnalyzer.save(DependencyAnalyzer.java:165)
        at
org.sonar.plugins.cxx.squid.CxxSquidSensor.save(CxxSquidSensor.java:196)
        at
org.sonar.plugins.cxx.squid.CxxSquidSensor.analyse(CxxSquidSensor.java:129)
        at
org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:79)
        at
org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:70)
        at
org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:119)
        at
org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:194)
        at
org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
        at
org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
        at
org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:233)
        at
org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:228)
        at
org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:221)
        at
org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
        at
org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
        at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:64)
        at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:51)
        at
org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:125)
        at
org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)

For this kind of rule specification:
@Rule(
  key = "CycleBetweenPackages",
  name = "Avoid cyclic dependency between packages",
  tags = {Tags.CONVENTION},
  priority = Priority.MAJOR)
@ActivatedByDefault
@SqaleSubCharacteristic(RulesDefinition.SubCharacteristics.ARCHITECTURE_RELIABILITY)
@SqaleConstantRemediation("5min")
public class CycleBetweenPackagesCheck extends SquidCheck<Grammar> {

This occurs in sonar 5.1

Thanks in advance




-----
Best Regards
Jorge Costa
--
View this message in context: http://sonarqube.15.x6.nabble.com/Rule-can-not-use-Constant-issue-remediation-tp5035013.html
Sent from the SonarQube Developers mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




Best Regards
Jorge Costa
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Rule can not use 'Constant/issue' remediation

Phyks
I was having troubles with sonar-cxx since the update from SonarQube 4 to SonarQube 5. See this Github issue for all the details : https://github.com/wenns/sonar-cxx/issues/437#issuecomment-99463976 (end of the issue, as the beginning is a different issue).

It was the same issue as Jorge had in the first post of this thread, which he solved by using the REST API.

I tried the solution in the Jira ticker which should solve the problem. I ran the SQL query
"UPDATE rules SET characteristic_id=NULL, remediation_function=NULL, remediation_coeff=NULL, remediation_offset=NULL WHERE characteristic_id IS NOT NULL;"

and did associated stuff in the "Without SQALE plugin" section, but the SQL query did not affect any rows and this did not solve anything concerning my issue.

Do you have any other mean to fix this issue ?

Thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Rule can not use 'Constant/issue' remediation

Julien Lancelot
Hi Phyks,

Could you try to execute the following query : 
UPDATE rules SET characteristic_id=NULL, remediation_function=NULL, remediation_coeff=NULL, remediation_offset=NULL 
WHERE characteristic_id IS NOT NULL OR remediation_function IS NOT NULL OR remediation_coeff IS NOT NULL OR remediation_offset IS NOT NULL

Then delete your data/es folder and restart your server.

Regards,

Julien LANCELOT | SonarSource

On 7 May 2015 at 15:45, Phyks <[hidden email]> wrote:
I was having troubles with sonar-cxx since the update from SonarQube 4 to
SonarQube 5. See this Github issue for all the details :
https://github.com/wenns/sonar-cxx/issues/437#issuecomment-99463976 (end of
the issue, as the beginning is a different issue).

It was the same issue as Jorge had in the first post of this thread, which
he solved by using the REST API.

I tried the solution in the Jira ticker which should solve the problem. I
ran the SQL query
"UPDATE rules SET characteristic_id=NULL, remediation_function=NULL,
remediation_coeff=NULL, remediation_offset=NULL WHERE characteristic_id IS
NOT NULL;"

and did associated stuff in the "Without SQALE plugin" section, but the SQL
query did not affect any rows and this did not solve anything concerning my
issue.

Do you have any other mean to fix this issue ?

Thanks



--
View this message in context: http://sonarqube.15.x6.nabble.com/Rule-can-not-use-Constant-issue-remediation-tp5035013p5035110.html
Sent from the SonarQube Developers mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Rule can not use 'Constant/issue' remediation

Phyks
Hi Julien,

I ran your SQL query and it did not affect any rows, just as the one in the JIRA ticket did. Then, after deleting the es folder and restarting the server, I still have the same issue :
ERROR: Caused by: Rule 'cxx:CycleBetweenPackages' can not use 'Constant/issue' remediation function because this rule does not have a fixed remediation cost.

Thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Rule can not use 'Constant/issue' remediation

Julien Lancelot
Hi,

Could you please send us the result of the following SQL query : SELECT * FROM rules WHERE plugin_name='css' AND plugin_rule_key='CycleBetweenPackages' ?

Regards,

Julien LANCELOT | SonarSource

On 11 May 2015 at 18:36, Phyks <[hidden email]> wrote:
Hi Julien,

I ran your SQL query and it did not affect any rows, just as the one in the
JIRA ticket did. Then, after deleting the es folder and restarting the
server, I still have the same issue :
ERROR: Caused by: Rule 'cxx:CycleBetweenPackages' can not use
'Constant/issue' remediation function because this rule does not have a
fixed remediation cost.

Thanks



--
View this message in context: http://sonarqube.15.x6.nabble.com/Rule-can-not-use-Constant-issue-remediation-tp5035013p5035231.html
Sent from the SonarQube Developers mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Rule can not use 'Constant/issue' remediation

Phyks
I replaced css by cxx in your SQL query, as I think this was a typo.

Here is the relevant output:
+------+----------------------+----------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+-------------+------------------------------------------+--------+----------+---------------------+---------------------+-----------------+-----------------+-----------------+-----------+-------------------+---------------------------+----------------------+------------------------------+-------------------+---------------------------+--------------------+----------------------------+---------------------------+------+-------------+-------------+--------------------+
| id   | plugin_rule_key      | plugin_config_key    | plugin_name | description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | priority | template_id | name                                     | status | language | created_at          | updated_at          | note_created_at | note_updated_at | note_user_login | note_data | characteristic_id | default_characteristic_id | remediation_function | default_remediation_function | remediation_coeff | default_remediation_coeff | remediation_offset | default_remediation_offset | effort_to_fix_description | tags | system_tags | is_template | description_format |
+------+----------------------+----------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+-------------+------------------------------------------+--------+----------+---------------------+---------------------+-----------------+-----------------+-----------------+-----------+-------------------+---------------------------+----------------------+------------------------------+-------------------+---------------------------+--------------------+----------------------------+---------------------------+------+-------------+-------------+--------------------+
| 2606 | CycleBetweenPackages | CycleBetweenPackages | cxx         | <p>
    When several packages are involved in a cycle (package A > package B > package C > package A where ">" means "depends upon"),
    that means that those packages are highly coupled and that there is no way to reuse/extract one of those packages without importing all the other packages.
    Such cycle could quickly increase the effort required to maintain an application and to embrace business change.
    SonarQube not only detects cycles between packages but also determines what is the minimum effort to break those cycles.
    This rule logs an issue on each source file having an outgoing dependency to be cut in order to break a cycle.
</p> |        2 |        NULL | Avoid cyclic dependency between packages | READY  | c++      | 2015-02-27 15:21:31 | 2015-05-04 09:44:52 | NULL            | NULL            | NULL            | NULL      |              NULL |                        38 | NULL                 | CONSTANT_ISSUE               | NULL              | NULL                      | NULL               | 5min                       | NULL                      | NULL | convention  |           0 | HTML               |
+------+----------------------+----------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+-------------+------------------------------------------+--------+----------+---------------------+---------------------+-----------------+-----------------+-----------------+-----------+-------------------+---------------------------+----------------------+------------------------------+-------------------+---------------------------+--------------------+----------------------------+---------------------------+------+-------------+-------------+--------------------+
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Rule can not use 'Constant/issue' remediation

Julien Lancelot
Could you please send it in a csv file ? Thanks. 

Julien LANCELOT | SonarSource

On 12 May 2015 at 14:04, Phyks <[hidden email]> wrote:
I replaced css by cxx in your SQL query, as I think this was a typo.

Here is the relevant output:
+------+----------------------+----------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+-------------+------------------------------------------+--------+----------+---------------------+---------------------+-----------------+-----------------+-----------------+-----------+-------------------+---------------------------+----------------------+------------------------------+-------------------+---------------------------+--------------------+----------------------------+---------------------------+------+-------------+-------------+--------------------+
| id   | plugin_rule_key      | plugin_config_key    | plugin_name |
description
| priority | template_id | name                                     | status
| language | created_at          | updated_at          | note_created_at |
note_updated_at | note_user_login | note_data | characteristic_id |
default_characteristic_id | remediation_function |
default_remediation_function | remediation_coeff | default_remediation_coeff
| remediation_offset | default_remediation_offset |
effort_to_fix_description | tags | system_tags | is_template |
description_format |
+------+----------------------+----------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+-------------+------------------------------------------+--------+----------+---------------------+---------------------+-----------------+-----------------+-----------------+-----------+-------------------+---------------------------+----------------------+------------------------------+-------------------+---------------------------+--------------------+----------------------------+---------------------------+------+-------------+-------------+--------------------+
| 2606 | CycleBetweenPackages | CycleBetweenPackages | cxx         | <p>
    When several packages are involved in a cycle (package A > package B >
package C > package A where ">" means "depends upon"),
    that means that those packages are highly coupled and that there is no
way to reuse/extract one of those packages without importing all the other
packages.
    Such cycle could quickly increase the effort required to maintain an
application and to embrace business change.
    SonarQube not only detects cycles between packages but also determines
what is the minimum effort to break those cycles.
    This rule logs an issue on each source file having an outgoing
dependency to be cut in order to break a cycle.
</p> |        2 |        NULL | Avoid cyclic dependency between packages |
READY  | c++      | 2015-02-27 15:21:31 | 2015-05-04 09:44:52 | NULL
| NULL            | NULL            | NULL      |              NULL |
38 | NULL                 | CONSTANT_ISSUE               | NULL
| NULL                      | NULL               | 5min
| NULL                      | NULL | convention  |           0 | HTML
|
+------+----------------------+----------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+-------------+------------------------------------------+--------+----------+---------------------+---------------------+-----------------+-----------------+-----------------+-----------+-------------------+---------------------------+----------------------+------------------------------+-------------------+---------------------------+--------------------+----------------------------+---------------------------+------+-------------+-------------+--------------------+



--
View this message in context: http://sonarqube.15.x6.nabble.com/Rule-can-not-use-Constant-issue-remediation-tp5035013p5035271.html
Sent from the SonarQube Developers mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Rule can not use 'Constant/issue' remediation

Julien Lancelot
Ok, forget my last message, I've been able to read the result.
Unfortunately, everything seems ok on the rule. It seems that the plugin is really trying to add an effort to fix on this rule...

Or maybe, could you send your whole stacktrace ?

Regards,

Julien LANCELOT | SonarSource

On 12 May 2015 at 14:40, Julien Lancelot <[hidden email]> wrote:
Could you please send it in a csv file ? Thanks. 

Julien LANCELOT | SonarSource

On 12 May 2015 at 14:04, Phyks <[hidden email]> wrote:
I replaced css by cxx in your SQL query, as I think this was a typo.

Here is the relevant output:
+------+----------------------+----------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+-------------+------------------------------------------+--------+----------+---------------------+---------------------+-----------------+-----------------+-----------------+-----------+-------------------+---------------------------+----------------------+------------------------------+-------------------+---------------------------+--------------------+----------------------------+---------------------------+------+-------------+-------------+--------------------+
| id   | plugin_rule_key      | plugin_config_key    | plugin_name |
description
| priority | template_id | name                                     | status
| language | created_at          | updated_at          | note_created_at |
note_updated_at | note_user_login | note_data | characteristic_id |
default_characteristic_id | remediation_function |
default_remediation_function | remediation_coeff | default_remediation_coeff
| remediation_offset | default_remediation_offset |
effort_to_fix_description | tags | system_tags | is_template |
description_format |
+------+----------------------+----------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+-------------+------------------------------------------+--------+----------+---------------------+---------------------+-----------------+-----------------+-----------------+-----------+-------------------+---------------------------+----------------------+------------------------------+-------------------+---------------------------+--------------------+----------------------------+---------------------------+------+-------------+-------------+--------------------+
| 2606 | CycleBetweenPackages | CycleBetweenPackages | cxx         | <p>
    When several packages are involved in a cycle (package A > package B >
package C > package A where ">" means "depends upon"),
    that means that those packages are highly coupled and that there is no
way to reuse/extract one of those packages without importing all the other
packages.
    Such cycle could quickly increase the effort required to maintain an
application and to embrace business change.
    SonarQube not only detects cycles between packages but also determines
what is the minimum effort to break those cycles.
    This rule logs an issue on each source file having an outgoing
dependency to be cut in order to break a cycle.
</p> |        2 |        NULL | Avoid cyclic dependency between packages |
READY  | c++      | 2015-02-27 15:21:31 | 2015-05-04 09:44:52 | NULL
| NULL            | NULL            | NULL      |              NULL |
38 | NULL                 | CONSTANT_ISSUE               | NULL
| NULL                      | NULL               | 5min
| NULL                      | NULL | convention  |           0 | HTML
|
+------+----------------------+----------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+-------------+------------------------------------------+--------+----------+---------------------+---------------------+-----------------+-----------------+-----------------+-----------+-------------------+---------------------------+----------------------+------------------------------+-------------------+---------------------------+--------------------+----------------------------+---------------------------+------+-------------+-------------+--------------------+



--
View this message in context: http://sonarqube.15.x6.nabble.com/Rule-can-not-use-Constant-issue-remediation-tp5035013p5035271.html
Sent from the SonarQube Developers mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Rule can not use 'Constant/issue' remediation

Phyks
I'm really sorry, I did not see that the copy / pasting resulted in bad formatting in my previous message =( My bad.

Here is the whole stacktrace :
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 15.651s
Final Memory: 34M/786M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
        at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
        at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
        at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
        at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
        at org.sonar.runner.api.Runner.execute(Runner.java:100)
        at org.sonar.runner.Main.executeTask(Main.java:70)
        at org.sonar.runner.Main.execute(Main.java:59)
        at org.sonar.runner.Main.main(Main.java:53)
Caused by: java.lang.IllegalArgumentException: Rule 'cxx:CycleBetweenPackages' can not use 'Constant/issue' remediation
function because this rule does not have a fixed remediation cost.
        at org.sonar.batch.issue.ModuleIssues.calculateDebt(ModuleIssues.java:139)
        at org.sonar.batch.issue.ModuleIssues.updateIssue(ModuleIssues.java:132)
        at org.sonar.batch.issue.ModuleIssues.initAndAddIssue(ModuleIssues.java:100)
        at org.sonar.batch.issue.DefaultIssuable.addIssue(DefaultIssuable.java:56)
        at org.sonar.plugins.cxx.squid.DependencyAnalyzer.saveViolations(DependencyAnalyzer.java:225)
        at org.sonar.plugins.cxx.squid.DependencyAnalyzer.save(DependencyAnalyzer.java:165)
        at org.sonar.plugins.cxx.squid.CxxSquidSensor.save(CxxSquidSensor.java:196)
        at org.sonar.plugins.cxx.squid.CxxSquidSensor.analyse(CxxSquidSensor.java:129)
        at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:59)
        at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:51)
        at org.sonar.batch.phases.DatabaseModePhaseExecutor.execute(DatabaseModePhaseExecutor.java:120)
        at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:264)
        at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
        at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
        at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:235)
        at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:230)
        at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:220)
        at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
        at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
        at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:57)
        at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)
        at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:135)
        at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
        at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
        at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:158)
        at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)
        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
        at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
        ... 9 more

Thanks!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Rule can not use 'Constant/issue' remediation

Julien Lancelot
Ok, then it really seems that the plugin is trying to add an effort to fix on this rule, which is not possible as it's defined as a Constant/Issue function.


Julien LANCELOT | SonarSource

On 12 May 2015 at 14:57, Phyks <[hidden email]> wrote:
I'm really sorry, I did not see that the copy / pasting resulted in bad
formatting in my previous message =( My bad.

Here is the whole stacktrace :
INFO:
------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO:
------------------------------------------------------------------------
Total time: 15.651s
Final Memory: 34M/786M
INFO:
------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
        at
org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
        at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
        at java.security.AccessController.doPrivileged(Native Method)
        at
org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
        at
org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
        at
org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
        at org.sonar.runner.api.Runner.execute(Runner.java:100)
        at org.sonar.runner.Main.executeTask(Main.java:70)
        at org.sonar.runner.Main.execute(Main.java:59)
        at org.sonar.runner.Main.main(Main.java:53)
Caused by: java.lang.IllegalArgumentException: Rule
'cxx:CycleBetweenPackages' can not use 'Constant/issue' remediation
function because this rule does not have a fixed remediation cost.
        at
org.sonar.batch.issue.ModuleIssues.calculateDebt(ModuleIssues.java:139)
        at
org.sonar.batch.issue.ModuleIssues.updateIssue(ModuleIssues.java:132)
        at
org.sonar.batch.issue.ModuleIssues.initAndAddIssue(ModuleIssues.java:100)
        at
org.sonar.batch.issue.DefaultIssuable.addIssue(DefaultIssuable.java:56)
        at
org.sonar.plugins.cxx.squid.DependencyAnalyzer.saveViolations(DependencyAnalyzer.java:225)
        at
org.sonar.plugins.cxx.squid.DependencyAnalyzer.save(DependencyAnalyzer.java:165)
        at
org.sonar.plugins.cxx.squid.CxxSquidSensor.save(CxxSquidSensor.java:196)
        at
org.sonar.plugins.cxx.squid.CxxSquidSensor.analyse(CxxSquidSensor.java:129)
        at
org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:59)
        at
org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:51)
        at
org.sonar.batch.phases.DatabaseModePhaseExecutor.execute(DatabaseModePhaseExecutor.java:120)
        at
org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:264)
        at
org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
        at
org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
        at
org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:235)
        at
org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:230)
        at
org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:220)
        at
org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
        at
org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
        at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:57)
        at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)
        at
org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:135)
        at
org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
        at
org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
        at
org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:158)
        at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)
        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
        at
org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at
org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
        ... 9 more

Thanks!



--
View this message in context: http://sonarqube.15.x6.nabble.com/Rule-can-not-use-Constant-issue-remediation-tp5035013p5035276.html
Sent from the SonarQube Developers mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Rule can not use 'Constant/issue' remediation

Phyks
Ok.

Do you have any lead on how to fix this?

As far as I understand, I should update the CONSTANT_ISSUE in the database with something else, but I am not sure of what I should put instead.

Thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Rule can not use 'Constant/issue' remediation

Julien Lancelot
No, that's not the right thing to do. 
The db is updated on each startup with information from the plugin. The plugin say that this rule is a Constant/File, but in the same time it's creating an issue with an effort to fix, which is reserved for rules with Linear function.

When somebody encounters the "XXX can not use 'Constant/issue' remediation function because this rule does not have a fixed remediation cost.", most of the time it's because the rule technical debt definitions has been badly overloaded by a migration in SonarQube 4.3, then the fix is to reset the technical debt by executing the SQL query you've already executed.

In your case I've no idea from where the issue is coming...
Are you the only one who are using this plugin ? Is it a snapshot version ?



Julien LANCELOT | SonarSource

On 12 May 2015 at 15:26, Phyks <[hidden email]> wrote:
Ok.

Do you have any lead on how to fix this?

As far as I understand, I should update the CONSTANT_ISSUE in the database
with something else, but I am not sure of what I should put instead.

Thanks



--
View this message in context: http://sonarqube.15.x6.nabble.com/Rule-can-not-use-Constant-issue-remediation-tp5035013p5035280.html
Sent from the SonarQube Developers mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Rule can not use 'Constant/issue' remediation

Jorge Costa

Hi Julien,

This is the code for this rule https://github.com/wenns/sonar-cxx/blob/master/cxx-checks/src/main/java/org/sonar/cxx/checks/CycleBetweenPackagesCheck.java I did not find anything wrong with this.

I run into this issue, but was able to fix it by using the rest api. So seems to me that there is still something in database incorrect.

One thing to try is to run the analysis in a newly created database and untouched plugin, in this case I think there should not be any problems


On Tue, May 12, 2015, 16:54 Julien Lancelot <[hidden email]> wrote:
No, that's not the right thing to do. 
The db is updated on each startup with information from the plugin. The plugin say that this rule is a Constant/File, but in the same time it's creating an issue with an effort to fix, which is reserved for rules with Linear function.

When somebody encounters the "XXX can not use 'Constant/issue' remediation function because this rule does not have a fixed remediation cost.", most of the time it's because the rule technical debt definitions has been badly overloaded by a migration in SonarQube 4.3, then the fix is to reset the technical debt by executing the SQL query you've already executed.

In your case I've no idea from where the issue is coming...
Are you the only one who are using this plugin ? Is it a snapshot version ?



Julien LANCELOT | SonarSource

On 12 May 2015 at 15:26, Phyks <[hidden email]> wrote:
Ok.

Do you have any lead on how to fix this?

As far as I understand, I should update the CONSTANT_ISSUE in the database
with something else, but I am not sure of what I should put instead.

Thanks



--
View this message in context: http://sonarqube.15.x6.nabble.com/Rule-can-not-use-Constant-issue-remediation-tp5035013p5035280.html
Sent from the SonarQube Developers mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Best Regards
Jorge Costa
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Rule can not use 'Constant/issue' remediation

Julien Lancelot
Hi Jorge,

Indeed, the class defining the rule is ok. 
What I really don't understand is that Phyks db seems ok.

But indeed, Phyks, could try on a new database ?

Regards,

Julien LANCELOT | SonarSource

On 12 May 2015 at 16:06, Jorge Costa <[hidden email]> wrote:

Hi Julien,

This is the code for this rule https://github.com/wenns/sonar-cxx/blob/master/cxx-checks/src/main/java/org/sonar/cxx/checks/CycleBetweenPackagesCheck.java I did not find anything wrong with this.

I run into this issue, but was able to fix it by using the rest api. So seems to me that there is still something in database incorrect.

One thing to try is to run the analysis in a newly created database and untouched plugin, in this case I think there should not be any problems


On Tue, May 12, 2015, 16:54 Julien Lancelot <[hidden email]> wrote:
No, that's not the right thing to do. 
The db is updated on each startup with information from the plugin. The plugin say that this rule is a Constant/File, but in the same time it's creating an issue with an effort to fix, which is reserved for rules with Linear function.

When somebody encounters the "XXX can not use 'Constant/issue' remediation function because this rule does not have a fixed remediation cost.", most of the time it's because the rule technical debt definitions has been badly overloaded by a migration in SonarQube 4.3, then the fix is to reset the technical debt by executing the SQL query you've already executed.

In your case I've no idea from where the issue is coming...
Are you the only one who are using this plugin ? Is it a snapshot version ?



Julien LANCELOT | SonarSource

On 12 May 2015 at 15:26, Phyks <[hidden email]> wrote:
Ok.

Do you have any lead on how to fix this?

As far as I understand, I should update the CONSTANT_ISSUE in the database
with something else, but I am not sure of what I should put instead.

Thanks



--
View this message in context: http://sonarqube.15.x6.nabble.com/Rule-can-not-use-Constant-issue-remediation-tp5035013p5035280.html
Sent from the SonarQube Developers mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Rule can not use 'Constant/issue' remediation

Phyks
Hi Julien,

I tried it on a fresh install and there does not seem to be any problem.

It would be better if I could fix it without losing my profiles and settings though =(
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Rule can not use 'Constant/issue' remediation

Phyks
Hi,

Actually, I mistakenly thought this issue was solved as I did not reproduce it on a brand new 5.1 install. But I solved some issues in the meantime. But the problem is there again.

Here is what I did :
* Brand new SonarQube 5.1 install, run an analysis, no problem.
* Load the quality profile from my previous install (the faulty one), re-run the analysis, same issue as before (constant/issue remediation).
* Run an analysis on a very basic code which do not trigger all the possible issues in my previous quality profile, no problem.

So I think this is due to a particular rule, upon activation. However, I have to keep my previous quality profile, as it will take a very long time to recreate it, and I have absolutely no idea where to look to disable the faulty rule to be able to scan again…

Thanks
12
Loading...