squid:CycleBetweenPackages also triggered when only referenced in {@link} in javadoc

62 views
Skip to first unread message

BalusC

unread,
Mar 1, 2016, 4:47:17 AM3/1/16
to SonarQube
Imagine a class in a main package and a related class in a subpackage.

package com.example;

import com.example.foo.Bar;

public class Foo {
   
public void foo() {
       
Bar bar = new Bar();
   
}
}

package com.example.foo;

/**
 * This bars the Foo.
 */

public class Bar {
   
}

The related (kind of helper) class does by itself do nothing with the main class. However, for sake of documentation I'd like to link to Foo in javadoc.

package com.example.foo;

import com.example.Foo;

/**
 * This bars the {@link Foo}.
 */

public class Bar {
   
}

This only requires an import. It's exactly this import which triggers a false squid:CycleBetweenPackages warning. Even a FQN link like below still triggers this warning.

package com.example.foo;

/**
 * This bars the {@link com.example.Foo}.
 */

public class Bar {
   
}

I can understand this is hard to fix/detect. How can I suppress the false squid:CycleBetweenPackages warning and still keep the link in javadoc?

Nicolas Peru

unread,
Mar 1, 2016, 8:10:15 AM3/1/16
to BalusC, SonarQube
Hi, 

This rule as relies on the DSM features which have already been deprecated on platform side. When the sonar java plugin will move to the new LTS version of the platform we have in mind to actually remove this feature from the plugin and that will actually deprecate this rule. 
As such, there is no point in improving it right now.

So for your spectific issue I would say that you should mark the issue as false positive or won't fix. 

Cheers, 

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/f8ae0ab3-7d29-4f38-a500-5ea6f339a091%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Nicolas PERU | SonarSource
Senior Developer
http://sonarsource.com
Reply all
Reply to author
Forward
0 new messages