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

SQ-5.2 background task: java.lang.IllegalArgumentException: Rule 'cxx:CycleBetweenPackages' #734

Closed
Bertk opened this issue Jan 2, 2016 · 5 comments
Assignees
Labels
Milestone

Comments

@Bertk
Copy link
Contributor

Bertk commented Jan 2, 2016

I observed an issue with SQALE remediation function for 'cxx:CycleBetweenPackages'. I disabled the rule and the results were loaded successfully to SQ DB.
@guwirth, @jmecosta: Did you also see this issues?

2016.01.02 16:33:47 ERROR [o.s.s.c.t.CeWorkerRunnableImpl] Failed to execute task AVIC-GwUbIrdtFH5k1IO
java.lang.IllegalStateException: Fail to process issues of component 'CudaSamples:CudaSamples:29A96CA4-8088-3B7B-E13E-540C8DB178CC:boost/config/abi_prefix.hpp'
    at org.sonar.server.computation.issue.IntegrateIssuesVisitor.processIssues(IntegrateIssuesVisitor.java:74) ~[sonar-server-5.2.jar:na]
    at org.sonar.server.computation.issue.IntegrateIssuesVisitor.visitAny(IntegrateIssuesVisitor.java:59) ~[sonar-server-5.2.jar:na]
    at org.sonar.server.computation.component.TypeAwareVisitorWrapper.visitAny(TypeAwareVisitorWrapper.java:83) ~[sonar-server-5.2.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visitNode(VisitorsCrawler.java:97) ~[sonar-server-5.2.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visit(VisitorsCrawler.java:80) ~[sonar-server-5.2.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:90) ~[sonar-server-5.2.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visit(VisitorsCrawler.java:77) ~[sonar-server-5.2.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:90) ~[sonar-server-5.2.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visit(VisitorsCrawler.java:77) ~[sonar-server-5.2.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:90) ~[sonar-server-5.2.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visit(VisitorsCrawler.java:77) ~[sonar-server-5.2.jar:na]
    at org.sonar.server.computation.step.ExecuteVisitorsStep.execute(ExecuteVisitorsStep.java:51) ~[sonar-server-5.2.jar:na]
    at org.sonar.server.computation.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:39) ~[sonar-server-5.2.jar:na]
    at org.sonar.server.computation.taskprocessor.report.ReportTaskProcessor.process(ReportTaskProcessor.java:53) ~[sonar-server-5.2.jar:na]
    at org.sonar.server.computation.taskprocessor.CeWorkerRunnableImpl.executeTask(CeWorkerRunnableImpl.java:78) [sonar-server-5.2.jar:na]
    at org.sonar.server.computation.taskprocessor.CeWorkerRunnableImpl.run(CeWorkerRunnableImpl.java:55) [sonar-server-5.2.jar:na]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [na:1.8.0_65]
    at java.util.concurrent.FutureTask.runAndReset(Unknown Source) [na:1.8.0_65]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) [na:1.8.0_65]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [na:1.8.0_65]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_65]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_65]
    at java.lang.Thread.run(Unknown Source) [na:1.8.0_65]
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.server.computation.issue.DebtCalculator.verifyEffortToFix(DebtCalculator.java:65) ~[sonar-server-5.2.jar:na]
    at org.sonar.server.computation.issue.DebtCalculator.calculate(DebtCalculator.java:46) ~[sonar-server-5.2.jar:na]
    at org.sonar.server.computation.issue.IssueLifecycle.initNewOpenIssue(IssueLifecycle.java:64) ~[sonar-server-5.2.jar:na]
    at org.sonar.server.computation.issue.IntegrateIssuesVisitor.fillNewOpenIssues(IntegrateIssuesVisitor.java:82) ~[sonar-server-5.2.jar:na]
    at org.sonar.server.computation.issue.IntegrateIssuesVisitor.processIssues(IntegrateIssuesVisitor.java:69) ~[sonar-server-5.2.jar:na]
    ... 22 common frames omitted
2016.01.02 16:33:47 ERROR [o.s.s.c.t.CeWorkerRunnableImpl] Executed task | project=CudaSamples | id=AVIC-GwUbIrdtFH5k1IO | time=45117ms
@jmecosta
Copy link
Member

jmecosta commented Jan 2, 2016

I had the same issue. I think I change the definition to be linear using
the sonar extension. I think you have issues with old definitions of this
rule. Try to run in a clean database, I think it will not fail

On Sat, Jan 2, 2016, 23:13 Bert [email protected] wrote:

I observed an issue with SQALE remediation function for
'cxx:CycleBetweenPackages'. I disabled the rule and the results were loaded
successfully to SQ DB.
@guwirth https://github.com/guwirth, @jmecosta
https://github.com/jmecosta: Did you also see this issues?

2016.01.02 16:33:47 ERROR [o.s.s.c.t.CeWorkerRunnableImpl] Failed to execute task AVIC-GwUbIrdtFH5k1IO
java.lang.IllegalStateException: Fail to process issues of component 'CudaSamples:CudaSamples:29A96CA4-8088-3B7B-E13E-540C8DB178CC:boost/config/abi_prefix.hpp'
at org.sonar.server.computation.issue.IntegrateIssuesVisitor.processIssues(IntegrateIssuesVisitor.java:74) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.issue.IntegrateIssuesVisitor.visitAny(IntegrateIssuesVisitor.java:59) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.component.TypeAwareVisitorWrapper.visitAny(TypeAwareVisitorWrapper.java:83) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.component.VisitorsCrawler.visitNode(VisitorsCrawler.java:97) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.component.VisitorsCrawler.visit(VisitorsCrawler.java:80) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:90) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.component.VisitorsCrawler.visit(VisitorsCrawler.java:77) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:90) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.component.VisitorsCrawler.visit(VisitorsCrawler.java:77) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:90) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.component.VisitorsCrawler.visit(VisitorsCrawler.java:77) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.step.ExecuteVisitorsStep.execute(ExecuteVisitorsStep.java:51) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:39) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.taskprocessor.report.ReportTaskProcessor.process(ReportTaskProcessor.java:53) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.taskprocessor.CeWorkerRunnableImpl.executeTask(CeWorkerRunnableImpl.java:78) [sonar-server-5.2.jar:na]
at org.sonar.server.computation.taskprocessor.CeWorkerRunnableImpl.run(CeWorkerRunnableImpl.java:55) [sonar-server-5.2.jar:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [na:1.8.0_65]
at java.util.concurrent.FutureTask.runAndReset(Unknown Source) [na:1.8.0_65]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) [na:1.8.0_65]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [na:1.8.0_65]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_65]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_65]
at java.lang.Thread.run(Unknown Source) [na:1.8.0_65]
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.server.computation.issue.DebtCalculator.verifyEffortToFix(DebtCalculator.java:65) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.issue.DebtCalculator.calculate(DebtCalculator.java:46) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.issue.IssueLifecycle.initNewOpenIssue(IssueLifecycle.java:64) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.issue.IntegrateIssuesVisitor.fillNewOpenIssues(IntegrateIssuesVisitor.java:82) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.issue.IntegrateIssuesVisitor.processIssues(IntegrateIssuesVisitor.java:69) ~[sonar-server-5.2.jar:na]
... 22 common frames omitted
2016.01.02 16:33:47 ERROR [o.s.s.c.t.CeWorkerRunnableImpl] Executed task | project=CudaSamples | id=AVIC-GwUbIrdtFH5k1IO | time=45117ms


Reply to this email directly or view it on GitHub
#734.

@Bertk
Copy link
Contributor Author

Bertk commented Jan 3, 2016

Meanwhile I replaced the SQALE annotation with @NoSqale and the results were loaded to DB.
The update of the SQALE remediation parameters from PR #518 got somehow lost.
I updated the SQALE remediation annotation for CycleBetweenPackages and will test it.
(see also https://github.com/SonarSource/sslr-squid-bridge/blob/master/src/main/java/org/sonar/squidbridge/annotations/AnnotationBasedRulesDefinition.java)

@Rule(
  key = "CycleBetweenPackages",
  name = "Avoid cyclic dependency between packages",
  tags = {Tags.CONVENTION},
  priority = Priority.MAJOR)
@ActivatedByDefault
@SqaleSubCharacteristic(RulesDefinition.SubCharacteristics.ARCHITECTURE_RELIABILITY)
@SqaleLinearRemediation(coeff= "120min" , effortToFixDescription = "extract problematic methods and move it to separate package")

@jmecosta
Copy link
Member

jmecosta commented Jan 3, 2016

Wonder if it's because the definitions are in both places?

On Sun, Jan 3, 2016, 07:35 Bert [email protected] wrote:

Meanwhile I replaced the SQALE annotation with @NoSqale and the results
were loaded to DB.
The update of the SQALE remediation parameters from PR #518
#518 got somehow
lost.
I updated the SQALE remediation annotation for CycleBetweenPackages and
will test it.

@rule(
key = "CycleBetweenPackages",
name = "Avoid cyclic dependency between packages",
tags = {Tags.CONVENTION},
priority = Priority.MAJOR)
@ActivatedByDefault
@SqaleSubCharacteristic(RulesDefinition.SubCharacteristics.ARCHITECTURE_RELIABILITY)
@SqaleLinearRemediation(coeff= "120min" , effortToFixDescription = "extract problematic methods and move it to separate package")


Reply to this email directly or view it on GitHub
#734 (comment)
.

@Bertk
Copy link
Contributor Author

Bertk commented Jan 3, 2016

The cxx-checks sqale definitions should be removed from sonar-cxx-plugin/src/main/resources/com/sonar/sqale/cxx-model.xml.

@jmecosta
Copy link
Member

jmecosta commented Jan 3, 2016

I think so to, one thing I notice if you use the rest api is, if a def is
already set and you try to move to another it will fail and reset the def
to undefined. Then if you set again it works.

Wondering if the same happens on the batch side. That would explain it.
Also we need to be sure we don't have duplicate definitions

On Sun, Jan 3, 2016, 11:27 Bert [email protected] wrote:

The cxx-checks sqale definitions should be removed from
sonar-cxx-plugin/src/main/resources/com/sonar/sqale/cxx-model.xml.


Reply to this email directly or view it on GitHub
#734 (comment)
.

@guwirth guwirth removed the discussion label Jan 4, 2016
@guwirth guwirth added this to the M 0.9.5 milestone Jan 4, 2016
@guwirth guwirth closed this as completed Jan 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants