Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0
    • Component/s: None
    • Labels:
      None

      Description

      • Now that the FunctionDeclarationTree has a list of typed ParameterTree as parameters, some elements that were present in the AST as natives are not there anymore.
        Parameter initializers are not present anymore and should be readded.
        Fixing this should reduce FP rate of rule "Unused "private" methods should be removed".
        Example of FP for kotlin:
        data class NetworkInterface(
                val host: String = "localhost",
                val sshPort: Int = getPort(2222 + nodeIndex)) {
            init {
                nodeIndex += 1
            }
            companion object {
                private var nodeIndex = 0
                private fun getPort(suggestedPortNumber: Int): Int {
                    // Do something ...
                }
            }
        }
        

        getPort method raises an issue, when it should not

      • Constructor delegation is also missing from the AST.
        Ex:
        class A(a: int) { 
          constructor(): this(getValue(0)) {}
          companion object {
                private fun getValue(b: Int) = b + 1
          }
        }
        

        The : this(getValue(0)) does not appear anywhere in the AST. This causes FP in for "Unused "private" methods should be removed" rule.

      • Generic type for functions are missing
        fun <A> f1() {}
        

        The <A> information is currently lost and missing in the AST after convertion

        Attachments

          Activity

            People

            • Assignee:
              christophe.zurn Christophe Zurn
              Reporter:
              christophe.zurn Christophe Zurn
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: