-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Results of running Scapegoat against Scapegoat #305
Comments
Hmm. How can we run against our code base?
|
More than half of the warnings reported above are |
You need to temporarily change the name of the project so it's different from |
With current
|
Fresh run: Scapegoat InspectionsErrors: 0 Warnings: 42 Infos: 19 Reportcom.sksamuel.scapegoat.Feedback.scala:83Level: Info Inspection: com.sksamuel.scapegoat.inspections.FinalModifierOnCaseClass Missing final modifier on case class Using case classes without final modifier can lead to surprising breakage. com.sksamuel.scapegoat.Inspection.scala:37Level: Info Inspection: com.sksamuel.scapegoat.inspections.FinalModifierOnCaseClass Missing final modifier on case class Using case classes without final modifier can lead to surprising breakage. com.sksamuel.scapegoat.inspections.DoubleNegation.scala:23Level: Warning Inspection: com.sksamuel.scapegoat.inspections.string.LooksLikeInterpolatedString Looks like interpolated String Did you forget to prefix this string with an s, f or raw to interpolate it? com.sksamuel.scapegoat.inspections.MaxParameters.scala:25Level: Info Inspection: com.sksamuel.scapegoat.inspections.collections.ListSize List.size is O(n) List.size is O(n). Consider using a different data type with O(1) size lookup such as Vector or an Array. com.sksamuel.scapegoat.inspections.NoOpOverride.scala:24Level: Info Inspection: com.sksamuel.scapegoat.inspections.collections.ListSize List.size is O(n) List.size is O(n). Consider using a different data type with O(1) size lookup such as Vector or an Array. com.sksamuel.scapegoat.inspections.NoOpOverride.scala:24Level: Info Inspection: com.sksamuel.scapegoat.inspections.collections.ListSize List.size is O(n) List.size is O(n). Consider using a different data type with O(1) size lookup such as Vector or an Array. com.sksamuel.scapegoat.inspections.NoOpOverride.scala:34Level: Info Inspection: com.sksamuel.scapegoat.inspections.collections.ListSize List.size is O(n) List.size is O(n). Consider using a different data type with O(1) size lookup such as Vector or an Array. com.sksamuel.scapegoat.inspections.VarClosure.scala:26Level: Info Inspection: com.sksamuel.scapegoat.inspections.collections.ListAppend List append is slow List append is O(n). For large lists, consider using cons (::) or another data structure such as ListBuffer, Vector or a cats.data.Chain (which has constant prepend and append). com.sksamuel.scapegoat.inspections.collections.CollectionPromotionToAny.scala:44Level: Warning Inspection: com.sksamuel.scapegoat.inspections.nulls.NullParameter Null parameter Use an Option instead when the value can be empty and pass down a None instead. select.symbol.!=(null) com.sksamuel.scapegoat.inspections.collections.DuplicateMapKey.scala:30Level: Info Inspection: com.sksamuel.scapegoat.inspections.collections.ListAppend List append is slow List append is O(n). For large lists, consider using cons (::) or another data structure such as ListBuffer, Vector or a cats.data.Chain (which has constant prepend and append). com.sksamuel.scapegoat.inspections.collections.DuplicateMapKey.scala:34Level: Info Inspection: com.sksamuel.scapegoat.inspections.collections.ListSize List.size is O(n) List.size is O(n). Consider using a different data type with O(1) size lookup such as Vector or an Array. com.sksamuel.scapegoat.inspections.collections.DuplicateSetValue.scala:28Level: Info Inspection: com.sksamuel.scapegoat.inspections.collections.ListSize List.size is O(n) List.size is O(n). Consider using a different data type with O(1) size lookup such as Vector or an Array. com.sksamuel.scapegoat.inspections.collections.NegationIsEmpty.scala:24Level: Warning Inspection: com.sksamuel.scapegoat.inspections.string.LooksLikeInterpolatedString Looks like interpolated String Did you forget to prefix this string with an s, f or raw to interpolate it? com.sksamuel.scapegoat.inspections.collections.NegationNonEmpty.scala:24Level: Warning Inspection: com.sksamuel.scapegoat.inspections.string.LooksLikeInterpolatedString Looks like interpolated String Did you forget to prefix this string with an s, f or raw to interpolate it? com.sksamuel.scapegoat.inspections.collections.UnsafeContains.scala:35Level: Warning Inspection: com.sksamuel.scapegoat.inspections.unsafe.IsInstanceOf Use of isInstanceOf Use of isInstanceOf is considered a bad practice - consider using pattern matching instead. elem.isInstanceOf[Any] com.sksamuel.scapegoat.inspections.equality.ComparingUnrelatedTypes.scala:35Level: Warning Inspection: com.sksamuel.scapegoat.inspections.nulls.NullParameter Null parameter Use an Option instead when the value can be empty and pass down a None instead. literal.value.convertTo(targetType).!=(null) com.sksamuel.scapegoat.inspections.inference.ProductWithSerializableInferred.scala:32Level: Info Inspection: com.sksamuel.scapegoat.inspections.collections.ListSize List.size is O(n) List.size is O(n). Consider using a different data type with O(1) size lookup such as Vector or an Array. com.sksamuel.scapegoat.inspections.matching.RepeatedCaseBody.scala:26Level: Info Inspection: com.sksamuel.scapegoat.inspections.collections.ListSize List.size is O(n) List.size is O(n). Consider using a different data type with O(1) size lookup such as Vector or an Array. com.sksamuel.scapegoat.inspections.matching.RepeatedCaseBody.scala:30Level: Info Inspection: com.sksamuel.scapegoat.inspections.collections.ListSize List.size is O(n) List.size is O(n). Consider using a different data type with O(1) size lookup such as Vector or an Array. com.sksamuel.scapegoat.inspections.math.UseLog10.scala:10Level: Warning Inspection: com.sksamuel.scapegoat.inspections.string.LooksLikeInterpolatedString Looks like interpolated String Did you forget to prefix this string with an s, f or raw to interpolate it? com.sksamuel.scapegoat.inspections.math.UseLog1P.scala:10Level: Warning Inspection: com.sksamuel.scapegoat.inspections.string.LooksLikeInterpolatedString Looks like interpolated String Did you forget to prefix this string with an s, f or raw to interpolate it? com.sksamuel.scapegoat.inspections.math.UseSqrt.scala:10Level: Warning Inspection: com.sksamuel.scapegoat.inspections.string.LooksLikeInterpolatedString Looks like interpolated String Did you forget to prefix this string with an s, f or raw to interpolate it? com.sksamuel.scapegoat.inspections.naming.MethodNames.scala:26Level: Warning Inspection: com.sksamuel.scapegoat.inspections.string.LooksLikeInterpolatedString Looks like interpolated String Did you forget to prefix this string with an s, f or raw to interpolate it? com.sksamuel.scapegoat.inspections.nulls.NullAssignment.scala:28Level: Warning Inspection: com.sksamuel.scapegoat.inspections.string.LooksLikeInterpolatedString Looks like interpolated String Did you forget to prefix this string with an s, f or raw to interpolate it? com.sksamuel.scapegoat.inspections.string.IllegalFormatString.scala:39Level: Warning Inspection: com.sksamuel.scapegoat.inspections.nulls.NullParameter Null parameter Use an Option instead when the value can be empty and pass down a None instead. scala.collection.immutable.Nil.padTo[Null](argCount, null) com.sksamuel.scapegoat.inspections.string.IncorrectNumberOfArgsToFormat.scala:47Level: Info Inspection: com.sksamuel.scapegoat.inspections.collections.ListSize List.size is O(n) List.size is O(n). Consider using a different data type with O(1) size lookup such as Vector or an Array. com.sksamuel.scapegoat.inspections.unneccesary.UnusedMethodParameter.scala:74Level: Info Inspection: com.sksamuel.scapegoat.inspections.RedundantFinalModifierOnMethod Redundant final modifier on a method A final modifier on methods that cannot be overridden is redundant. com.sksamuel.scapegoat.inspections.unneccesary.VarCouldBeVal.scala:27Level: Info Inspection: com.sksamuel.scapegoat.inspections.collections.ListAppend List append is slow List append is O(n). For large lists, consider using cons (::) or another data structure such as ListBuffer, Vector or a cats.data.Chain (which has constant prepend and append). com.sksamuel.scapegoat.inspections.unneccesary.VarCouldBeVal.scala:68Level: Info Inspection: com.sksamuel.scapegoat.inspections.collections.ListAppend List append is slow List append is O(n). For large lists, consider using cons (::) or another data structure such as ListBuffer, Vector or a cats.data.Chain (which has constant prepend and append). com.sksamuel.scapegoat.inspections.unneccesary.VarCouldBeVal.scala:65Level: Info Inspection: com.sksamuel.scapegoat.inspections.RedundantFinalModifierOnMethod Redundant final modifier on a method A final modifier on methods that cannot be overridden is redundant. com.sksamuel.scapegoat.inspections.unsafe.FinalizerWithoutSuper.scala:28Level: Info Inspection: com.sksamuel.scapegoat.inspections.collections.ListAppend List append is slow List append is O(n). For large lists, consider using cons (::) or another data structure such as ListBuffer, Vector or a cats.data.Chain (which has constant prepend and append). com.sksamuel.scapegoat.io.HtmlReportWriter.scala:68Level: Warning Inspection: com.sksamuel.scapegoat.inspections.nulls.NullParameter Null parameter Use an Option instead when the value can be empty and pass down a None instead. new scala.xml.Elem(null, "head", scala.xml.Null, scala.xml.TopScope, false, (xml.this.NodeSeq.seqToNodeSeq({
val $buf: scala.xml.NodeBuffer = new scala.xml.NodeBuffer();
$buf.&+(new scala.xml.Text("\n "));
$buf.&+({
{
new scala.xml.Elem(null, "title", scala.xml.Null, scala.xml.T com.sksamuel.scapegoat.io.HtmlReportWriter.scala:87Level: Warning Inspection: com.sksamuel.scapegoat.inspections.nulls.NullParameter Null parameter Use an Option instead when the value can be empty and pass down a None instead. new scala.xml.Elem(null, "body", scala.xml.Null, scala.xml.TopScope, false, (xml.this.NodeSeq.seqToNodeSeq({
val $buf: scala.xml.NodeBuffer = new scala.xml.NodeBuffer();
$buf.&+(new scala.xml.Text("\n "));
$buf.&+({
{
new scala.xml.Elem(null, "h1", scala.xml.Null, scala.xml.TopS com.sksamuel.scapegoat.io.HtmlReportWriter.scala:133Level: Warning Inspection: com.sksamuel.scapegoat.inspections.nulls.NullParameter Null parameter Use an Option instead when the value can be empty and pass down a None instead. new scala.xml.Elem(null, "html", scala.xml.Null, scala.xml.TopScope, false, (xml.this.NodeSeq.seqToNodeSeq({
val $buf: scala.xml.NodeBuffer = new scala.xml.NodeBuffer();
$buf.&+(new scala.xml.Text("\n "));
$buf.&+(HtmlReportWriter.this.header);
$buf.&+(HtmlReportWriter.this.body(reporte com.sksamuel.scapegoat.io.HtmlReportWriter.scala:69Level: Warning Inspection: com.sksamuel.scapegoat.inspections.VariableShadowing Variable shadowing Variable shadowing is very useful, but can easily lead to nasty bugs in your code. Shadowed variables can be potentially confusing to other maintainers when the same name is adopted to have a new meaning in a nested scope. val $buf: scala.xml.NodeBuffer = new scala.xml.NodeBuffer() com.sksamuel.scapegoat.io.HtmlReportWriter.scala:81Level: Warning Inspection: com.sksamuel.scapegoat.inspections.VariableShadowing Variable shadowing Variable shadowing is very useful, but can easily lead to nasty bugs in your code. Shadowed variables can be potentially confusing to other maintainers when the same name is adopted to have a new meaning in a nested scope. val $buf: scala.xml.NodeBuffer = new scala.xml.NodeBuffer() com.sksamuel.scapegoat.io.HtmlReportWriter.scala:88Level: Warning Inspection: com.sksamuel.scapegoat.inspections.VariableShadowing Variable shadowing Variable shadowing is very useful, but can easily lead to nasty bugs in your code. Shadowed variables can be potentially confusing to other maintainers when the same name is adopted to have a new meaning in a nested scope. val $buf: scala.xml.NodeBuffer = new scala.xml.NodeBuffer() com.sksamuel.scapegoat.io.HtmlReportWriter.scala:89Level: Warning Inspection: com.sksamuel.scapegoat.inspections.VariableShadowing Variable shadowing Variable shadowing is very useful, but can easily lead to nasty bugs in your code. Shadowed variables can be potentially confusing to other maintainers when the same name is adopted to have a new meaning in a nested scope. val $buf: scala.xml.NodeBuffer = new scala.xml.NodeBuffer() com.sksamuel.scapegoat.io.HtmlReportWriter.scala:103Level: Warning Inspection: com.sksamuel.scapegoat.inspections.VariableShadowing Variable shadowing Variable shadowing is very useful, but can easily lead to nasty bugs in your code. Shadowed variables can be potentially confusing to other maintainers when the same name is adopted to have a new meaning in a nested scope. var $md: scala.xml.MetaData = scala.xml.Null com.sksamuel.scapegoat.io.HtmlReportWriter.scala:103Level: Warning Inspection: com.sksamuel.scapegoat.inspections.VariableShadowing Variable shadowing Variable shadowing is very useful, but can easily lead to nasty bugs in your code. Shadowed variables can be potentially confusing to other maintainers when the same name is adopted to have a new meaning in a nested scope. val $buf: scala.xml.NodeBuffer = new scala.xml.NodeBuffer() com.sksamuel.scapegoat.io.HtmlReportWriter.scala:106Level: Warning Inspection: com.sksamuel.scapegoat.inspections.VariableShadowing Variable shadowing Variable shadowing is very useful, but can easily lead to nasty bugs in your code. Shadowed variables can be potentially confusing to other maintainers when the same name is adopted to have a new meaning in a nested scope. var $md: scala.xml.MetaData = scala.xml.Null com.sksamuel.scapegoat.io.HtmlReportWriter.scala:106Level: Warning Inspection: com.sksamuel.scapegoat.inspections.VariableShadowing Variable shadowing Variable shadowing is very useful, but can easily lead to nasty bugs in your code. Shadowed variables can be potentially confusing to other maintainers when the same name is adopted to have a new meaning in a nested scope. val $buf: scala.xml.NodeBuffer = new scala.xml.NodeBuffer() com.sksamuel.scapegoat.io.HtmlReportWriter.scala:109Level: Warning Inspection: com.sksamuel.scapegoat.inspections.VariableShadowing Variable shadowing Variable shadowing is very useful, but can easily lead to nasty bugs in your code. Shadowed variables can be potentially confusing to other maintainers when the same name is adopted to have a new meaning in a nested scope. var $md: scala.xml.MetaData = scala.xml.Null com.sksamuel.scapegoat.io.HtmlReportWriter.scala:109Level: Warning Inspection: com.sksamuel.scapegoat.inspections.VariableShadowing Variable shadowing Variable shadowing is very useful, but can easily lead to nasty bugs in your code. Shadowed variables can be potentially confusing to other maintainers when the same name is adopted to have a new meaning in a nested scope. val $buf: scala.xml.NodeBuffer = new scala.xml.NodeBuffer() com.sksamuel.scapegoat.io.HtmlReportWriter.scala:110Level: Warning Inspection: com.sksamuel.scapegoat.inspections.VariableShadowing Variable shadowing Variable shadowing is very useful, but can easily lead to nasty bugs in your code. Shadowed variables can be potentially confusing to other maintainers when the same name is adopted to have a new meaning in a nested scope. var $md: scala.xml.MetaData = scala.xml.Null com.sksamuel.scapegoat.io.HtmlReportWriter.scala:110Level: Warning Inspection: com.sksamuel.scapegoat.inspections.VariableShadowing Variable shadowing Variable shadowing is very useful, but can easily lead to nasty bugs in your code. Shadowed variables can be potentially confusing to other maintainers when the same name is adopted to have a new meaning in a nested scope. val $buf: scala.xml.NodeBuffer = new scala.xml.NodeBuffer() com.sksamuel.scapegoat.io.HtmlReportWriter.scala:111Level: Warning Inspection: com.sksamuel.scapegoat.inspections.VariableShadowing Variable shadowing Variable shadowing is very useful, but can easily lead to nasty bugs in your code. Shadowed variables can be potentially confusing to other maintainers when the same name is adopted to have a new meaning in a nested scope. var $md: scala.xml.MetaData = scala.xml.Null com.sksamuel.scapegoat.io.HtmlReportWriter.scala:111Level: Warning Inspection: com.sksamuel.scapegoat.inspections.VariableShadowing Variable shadowing Variable shadowing is very useful, but can easily lead to nasty bugs in your code. Shadowed variables can be potentially confusing to other maintainers when the same name is adopted to have a new meaning in a nested scope. val $buf: scala.xml.NodeBuffer = new scala.xml.NodeBuffer() com.sksamuel.scapegoat.io.HtmlReportWriter.scala:113Level: Warning Inspection: com.sksamuel.scapegoat.inspections.VariableShadowing Variable shadowing Variable shadowing is very useful, but can easily lead to nasty bugs in your code. Shadowed variables can be potentially confusing to other maintainers when the same name is adopted to have a new meaning in a nested scope. var $md: scala.xml.MetaData = scala.xml.Null com.sksamuel.scapegoat.io.HtmlReportWriter.scala:113Level: Warning Inspection: com.sksamuel.scapegoat.inspections.VariableShadowing Variable shadowing Variable shadowing is very useful, but can easily lead to nasty bugs in your code. Shadowed variables can be potentially confusing to other maintainers when the same name is adopted to have a new meaning in a nested scope. val $buf: scala.xml.NodeBuffer = new scala.xml.NodeBuffer() com.sksamuel.scapegoat.io.HtmlReportWriter.scala:117Level: Warning Inspection: com.sksamuel.scapegoat.inspections.VariableShadowing Variable shadowing Variable shadowing is very useful, but can easily lead to nasty bugs in your code. Shadowed variables can be potentially confusing to other maintainers when the same name is adopted to have a new meaning in a nested scope. val $buf: scala.xml.NodeBuffer = new scala.xml.NodeBuffer() com.sksamuel.scapegoat.io.HtmlReportWriter.scala:123Level: Warning Inspection: com.sksamuel.scapegoat.inspections.VariableShadowing Variable shadowing Variable shadowing is very useful, but can easily lead to nasty bugs in your code. Shadowed variables can be potentially confusing to other maintainers when the same name is adopted to have a new meaning in a nested scope. var $md: scala.xml.MetaData = scala.xml.Null com.sksamuel.scapegoat.io.HtmlReportWriter.scala:123Level: Warning Inspection: com.sksamuel.scapegoat.inspections.VariableShadowing Variable shadowing Variable shadowing is very useful, but can easily lead to nasty bugs in your code. Shadowed variables can be potentially confusing to other maintainers when the same name is adopted to have a new meaning in a nested scope. val $buf: scala.xml.NodeBuffer = new scala.xml.NodeBuffer() com.sksamuel.scapegoat.io.ScalastyleReportWriter.scala:15Level: Warning Inspection: com.sksamuel.scapegoat.inspections.nulls.NullParameter Null parameter Use an Option instead when the value can be empty and pass down a None instead. new scala.xml.Elem(null, "checkstyle", $md, scala.xml.TopScope, false, (xml.this.NodeSeq.seqToNodeSeq({
val $buf: scala.xml.NodeBuffer = new scala.xml.NodeBuffer();
$buf.&+(new scala.xml.Text("\n "));
$buf.&+(feedback.warningsWithMinimalLevel.groupBy[String](((x$1: com.sksamuel.scapegoat. com.sksamuel.scapegoat.io.ScalastyleReportWriter.scala:21Level: Warning Inspection: com.sksamuel.scapegoat.inspections.nulls.NullParameter Null parameter Use an Option instead when the value can be empty and pass down a None instead. new scala.xml.Elem(null, "file", $md, scala.xml.TopScope, false, (xml.this.NodeSeq.seqToNodeSeq({
val $buf: scala.xml.NodeBuffer = new scala.xml.NodeBuffer();
$buf.&+(new scala.xml.Text("\n "));
$buf.&+(warnings.map[scala.xml.Elem](((warning: com.sksamuel.scapegoat.Warning) => ScalastyleR com.sksamuel.scapegoat.io.ScalastyleReportWriter.scala:27Level: Warning Inspection: com.sksamuel.scapegoat.inspections.nulls.NullParameter Null parameter Use an Option instead when the value can be empty and pass down a None instead. new scala.xml.Elem(null, "error", $md, scala.xml.TopScope, false) com.sksamuel.scapegoat.io.XmlReportWriter.scala:15Level: Warning Inspection: com.sksamuel.scapegoat.inspections.nulls.NullParameter Null parameter Use an Option instead when the value can be empty and pass down a None instead. new scala.xml.Elem(null, "scapegoat", $md, scala.xml.TopScope, false, (xml.this.NodeSeq.seqToNodeSeq({
val $buf: scala.xml.NodeBuffer = new scala.xml.NodeBuffer();
$buf.&+(new scala.xml.Text("\n "));
$buf.&+(feedback.warningsWithMinimalLevel.map[scala.xml.Elem](((warning: com.sksamuel.sca com.sksamuel.scapegoat.io.XmlReportWriter.scala:23Level: Warning Inspection: com.sksamuel.scapegoat.inspections.nulls.NullParameter Null parameter Use an Option instead when the value can be empty and pass down a None instead. new scala.xml.Elem(null, "warning", $md, scala.xml.TopScope, true) com.sksamuel.scapegoat.plugin.scala:47Level: Warning Inspection: com.sksamuel.scapegoat.inspections.unsafe.AsInstanceOf Use of asInstanceOf Use of asInstanceOf is considered a bad practice - consider using pattern matching instead. java.lang.Class.forName(inspection).getConstructor().newInstance().asInstanceOf[com.sksamuel.scapegoat.Inspection] com.sksamuel.scapegoat.plugin.scala:249Level: Warning Inspection: com.sksamuel.scapegoat.inspections.unsafe.AsInstanceOf Use of asInstanceOf Use of asInstanceOf is considered a bad practice - consider using pattern matching instead. tree.asInstanceOf[inspector.context.global.Tree] com.sksamuel.scapegoat.plugin.scala:146Level: Warning Inspection: com.sksamuel.scapegoat.inspections.VariableShadowing Variable shadowing Variable shadowing is very useful, but can easily lead to nasty bugs in your code. Shadowed variables can be potentially confusing to other maintainers when the same name is adopted to have a new meaning in a nested scope. val name: String = _ |
I've run the current Scapegoat snapshot against the codebase and you can find the full report below. It would be good to fix some of those issues and also set it up so that it gets run against the codebase as a PR check (and fails the PR on errors).
The text was updated successfully, but these errors were encountered: