报告排序和使用 head 或 last 并建议将其替换为 max 或 min。

示例:


  Seq("abc", "defg", "h").sorted.head
  Seq("abc", "defg", "h").sortBy(_.length).last

在应用快速修复后:


  Seq("abc", "defg", "h").min
  Seq("abc", "defg", "h").maxBy(_.length)