diff --git a/analysis/src/main/scala/org/polystat/odin/analysis/EOOdinAnalyzer.scala b/analysis/src/main/scala/org/polystat/odin/analysis/EOOdinAnalyzer.scala index f89290ca..def09b3d 100644 --- a/analysis/src/main/scala/org/polystat/odin/analysis/EOOdinAnalyzer.scala +++ b/analysis/src/main/scala/org/polystat/odin/analysis/EOOdinAnalyzer.scala @@ -30,7 +30,7 @@ object EOOdinAnalyzer { final case class Ok(override val ruleId: String) extends OdinAnalysisResult - final case class DefectDetected( + final case class DefectsDetected( override val ruleId: String, messages: NonEmptyList[String], ) extends OdinAnalysisResult @@ -44,7 +44,7 @@ object EOOdinAnalyzer { analyzer: String )(errors: List[String]): OdinAnalysisResult = errors match { - case e :: es => DefectDetected(analyzer, NonEmptyList(e, es)) + case e :: es => DefectsDetected(analyzer, NonEmptyList(e, es)) case Nil => Ok(analyzer) } @@ -103,13 +103,7 @@ object EOOdinAnalyzer { stream .compile .toList - .map { - case Nil => OdinAnalysisResult.Ok(name) - case e :: es => OdinAnalysisResult.DefectDetected( - name, - NonEmptyList(e, es) - ) - } + .map(OdinAnalysisResult.fromErrors(name)) } } diff --git a/analysis/src/main/scala/org/polystat/odin/analysis/stateaccess/DetectStateAccess.scala b/analysis/src/main/scala/org/polystat/odin/analysis/stateaccess/DetectStateAccess.scala index 6bbe5fdf..48d8b9fc 100644 --- a/analysis/src/main/scala/org/polystat/odin/analysis/stateaccess/DetectStateAccess.scala +++ b/analysis/src/main/scala/org/polystat/odin/analysis/stateaccess/DetectStateAccess.scala @@ -1,23 +1,8 @@ package org.polystat.odin.analysis.stateaccess import cats.data.EitherNel -import org.polystat.odin.analysis.inlining.{ - Abstract, - BndItself, - Inliner, - MethodInfo, - ObjectInfo, - ParentInfo -} -import org.polystat.odin.core.ast.{ - EOAnyNameBnd, - EOBndExpr, - EOCopy, - EODot, - EONamedBnd, - EOSimpleAppWithLocator, - LazyName -} +import org.polystat.odin.analysis.inlining._ +import org.polystat.odin.core.ast._ import org.polystat.odin.parser.eo.Parser object DetectStateAccess { diff --git a/analysis/src/test/scala/org/polystat/odin/analysis/DetectStateAccessTests.scala b/analysis/src/test/scala/org/polystat/odin/analysis/DetectStateAccessTests.scala index dff788d2..ef257af7 100644 --- a/analysis/src/test/scala/org/polystat/odin/analysis/DetectStateAccessTests.scala +++ b/analysis/src/test/scala/org/polystat/odin/analysis/DetectStateAccessTests.scala @@ -17,7 +17,7 @@ class DetectStateAccessTests extends AnyWordSpec { ) .flatMap { case Ok(_) => IO.pure(List.empty) - case DefectDetected(_, errors) => IO.pure(errors.toList) + case DefectsDetected(_, errors) => IO.pure(errors.toList) case AnalyzerFailure(_, e) => IO.raiseError(e) } diff --git a/interop/src/main/scala/org/polystat/odin/interop/java/OdinAnalysisResultInterop.scala b/interop/src/main/scala/org/polystat/odin/interop/java/OdinAnalysisResultInterop.scala index ba206115..fb044b1d 100644 --- a/interop/src/main/scala/org/polystat/odin/interop/java/OdinAnalysisResultInterop.scala +++ b/interop/src/main/scala/org/polystat/odin/interop/java/OdinAnalysisResultInterop.scala @@ -34,7 +34,7 @@ object OdinAnalysisResultInterop { java.util.Optional.empty, ) ) - case DefectDetected(rule, messages) => + case DefectsDetected(rule, messages) => List( new OdinAnalysisResultInterop( rule,