SonarQube Java
  1. SonarQube Java
  2. SONARJAVA-100

'Avoid commented out lines of code' false positive

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.1
    • Fix Version/s: None
    • Component/s: Rules
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Having otherwise blank lines in a block of commented-out code leads to the first content line after the blank line being flagged with a second violation. E.G. the following code gets marked with 2 "avoid commented-out lines of code" violations:

      //	private static JMSService instance = new JMSService();
      //	private org.w3c.dom.Element configElement = null;
      //	private ConcurrentHashMap<String, GenericQueueManagerConnection> hashQM = new ConcurrentHashMap<String, GenericQueueManagerConnection>();
      //	private String defaultQueueManager = null, defaultSendQueue = null, defaultRecieveQueue = null;
      //	private String appid = null;
      //
      //
      //
      //	private JMSService() {
      //
      //	}
      

        Activity

        Hide
        Evgeny Mandrikov added a comment -

        This ticket raises question - how many violations should be generated for:

        // private String appid = null;
        
        // private JMSService() {
        // }
        

        But in any case my opinion that this not worth cost of implementation.

        Show
        Evgeny Mandrikov added a comment - This ticket raises question - how many violations should be generated for: // private String appid = null; // private JMSService() { // } But in any case my opinion that this not worth cost of implementation.
        Hide
        G. Ann Campbell added a comment -

        Well, I reported that one too, but you slapped me down.

        Show
        G. Ann Campbell added a comment - Well, I reported that one too, but you slapped me down.
        Hide
        Evgeny Mandrikov added a comment -

        Sorry Ann, but we are not going to resolve this ticket, because ROI is really low.

        Show
        Evgeny Mandrikov added a comment - Sorry Ann, but we are not going to resolve this ticket, because ROI is really low.

          People

          • Assignee:
            Evgeny Mandrikov
            Reporter:
            G. Ann Campbell
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: