Uploaded image for project: 'SonarSlang'
  1. SonarSlang
  2. SONARSLANG-500

Rule S1144 shouldn't raise an issue when private method from companion object is used

    XMLWordPrintable

    Details

    • Type: False-Positive
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.8
    • Component/s: Scala
    • Labels:
      None

      Description

      Example:

      object Test {
        def main(args: Array[String]): Unit = {
          Test().usedMethod()
        }
      }
      
      case class Test() {
        private def usedMethod(): Unit = { // Should be compliant
          // some code here
        }
      }
      

      Source: https://community.sonarsource.com/t/private-method-used-from-companion-object-is-marked-as-unused/31771

        Attachments

          Activity

            People

            Assignee:
            andrei.epure Andrei Epure
            Reporter:
            margarita.nedzelska Margarita Nedzelska
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: