From ee044f87351708bb0213712120151b04f8332020 Mon Sep 17 00:00:00 2001 From: kevin-delmas Date: Fri, 13 Dec 2024 14:12:10 +0100 Subject: [PATCH] Manual refactoring --- .../onera/pmlanalyzer/pml/exporters/UMLExporter.scala | 2 +- .../pml/model/configuration/TransactionLibrary.scala | 8 -------- .../pmlanalyzer/pml/model/hardware/Transporter.scala | 2 -- .../scala/onera/pmlanalyzer/pml/operators/Merge.scala | 5 ----- src/main/scala/onera/pmlanalyzer/pml/operators/Use.scala | 5 ----- .../exporters/BasicOperationCeciliaExporter.scala | 2 +- .../dependability/exporters/ExprCeciliaExporter.scala | 4 ++-- .../views/dependability/exporters/Folder.scala | 2 +- .../pmlanalyzer/views/dependability/exporters/Model.scala | 2 +- .../pmlanalyzer/views/dependability/model/Software.scala | 4 ++-- .../views/dependability/operators/IsMergeable.scala | 2 -- 11 files changed, 8 insertions(+), 30 deletions(-) diff --git a/src/main/scala/onera/pmlanalyzer/pml/exporters/UMLExporter.scala b/src/main/scala/onera/pmlanalyzer/pml/exporters/UMLExporter.scala index 6ff9ac3..9de6598 100644 --- a/src/main/scala/onera/pmlanalyzer/pml/exporters/UMLExporter.scala +++ b/src/main/scala/onera/pmlanalyzer/pml/exporters/UMLExporter.scala @@ -629,7 +629,7 @@ object UMLExporter { c <- sw.hostingInitiators; s <- getId(sw); cs <- getId(c) } yield writeAssociation(s, cs) for { - c <- sw.hostingInitiators; b <- c.services; s <- getId(sw); + c <- sw.hostingInitiators; b <- c.services; s <- getId(sw) bs <- getId(b) } yield writeAssociation(s, bs) } diff --git a/src/main/scala/onera/pmlanalyzer/pml/model/configuration/TransactionLibrary.scala b/src/main/scala/onera/pmlanalyzer/pml/model/configuration/TransactionLibrary.scala index d5b9553..de62039 100644 --- a/src/main/scala/onera/pmlanalyzer/pml/model/configuration/TransactionLibrary.scala +++ b/src/main/scala/onera/pmlanalyzer/pml/model/configuration/TransactionLibrary.scala @@ -186,8 +186,6 @@ trait TransactionLibrary { * @param name * the implicit name of the transaction (deduced from val used during * instantiation) - * @param t - * the type tag used to distinguish application loads and stores * @tparam A * the type of requests * @return @@ -233,8 +231,6 @@ trait TransactionLibrary { * explicit name of the transaction * @param iniTgt * the application/target service used - * @param t - * the type tag used to distinguish application loads and stores * @tparam A * the type of requests * @return @@ -295,10 +291,6 @@ trait TransactionLibrary { * the set of initiator/target of right member * @param name * the implicitly derived name - * @param tA - * the type tag of left member to solve erasure issue - * @param tB - * the type tag of right member to solve erasure issue * @tparam A * the type of left request * @tparam B diff --git a/src/main/scala/onera/pmlanalyzer/pml/model/hardware/Transporter.scala b/src/main/scala/onera/pmlanalyzer/pml/model/hardware/Transporter.scala index 758dc9c..86d7c18 100644 --- a/src/main/scala/onera/pmlanalyzer/pml/model/hardware/Transporter.scala +++ b/src/main/scala/onera/pmlanalyzer/pml/model/hardware/Transporter.scala @@ -25,8 +25,6 @@ import sourcecode.Enclosing * @group transporter_class * @note * this class should not be specialised in user models - * @param name - * the name of the node * @param enclosing * the implicit context that can be used to find the source code location of * the node definition diff --git a/src/main/scala/onera/pmlanalyzer/pml/operators/Merge.scala b/src/main/scala/onera/pmlanalyzer/pml/operators/Merge.scala index b0259b0..c6eb2ec 100644 --- a/src/main/scala/onera/pmlanalyzer/pml/operators/Merge.scala +++ b/src/main/scala/onera/pmlanalyzer/pml/operators/Merge.scala @@ -46,11 +46,6 @@ object Merge { trait Ops { /** Extension method class - * - * @param x - * the element on which keyword can be used - * @tparam L - * the concrete type of the element */ extension [L](x: L) { diff --git a/src/main/scala/onera/pmlanalyzer/pml/operators/Use.scala b/src/main/scala/onera/pmlanalyzer/pml/operators/Use.scala index 5122053..fdbc9e7 100644 --- a/src/main/scala/onera/pmlanalyzer/pml/operators/Use.scala +++ b/src/main/scala/onera/pmlanalyzer/pml/operators/Use.scala @@ -176,11 +176,6 @@ object Use { } /** Extension method class - * - * @param self - * the element on which keyword can be used - * @tparam L - * the concrete type of the element */ extension [L <: Data](self: L) { diff --git a/src/main/scala/onera/pmlanalyzer/views/dependability/exporters/BasicOperationCeciliaExporter.scala b/src/main/scala/onera/pmlanalyzer/views/dependability/exporters/BasicOperationCeciliaExporter.scala index 020eb12..dc8e13e 100644 --- a/src/main/scala/onera/pmlanalyzer/views/dependability/exporters/BasicOperationCeciliaExporter.scala +++ b/src/main/scala/onera/pmlanalyzer/views/dependability/exporters/BasicOperationCeciliaExporter.scala @@ -43,7 +43,7 @@ trait BasicOperationCeciliaExporter { } def variablePathName(x: DepSystem, v: Variable[_]): String = { - s"${pathName(x, x.context.portOwner(v.id)).mkString(".")}.${v}" + s"${pathName(x, x.context.portOwner(v.id)).mkString(".")}.$v" } def mkVariableName( diff --git a/src/main/scala/onera/pmlanalyzer/views/dependability/exporters/ExprCeciliaExporter.scala b/src/main/scala/onera/pmlanalyzer/views/dependability/exporters/ExprCeciliaExporter.scala index c8d1091..85492c9 100644 --- a/src/main/scala/onera/pmlanalyzer/views/dependability/exporters/ExprCeciliaExporter.scala +++ b/src/main/scala/onera/pmlanalyzer/views/dependability/exporters/ExprCeciliaExporter.scala @@ -43,7 +43,7 @@ trait ExprCeciliaExporter { keys.map(k => k -> s"${lMap.result(k)} = ${rMap.result(k)}").toMap, lMap.subComponentAssertions ++ rMap.subComponentAssertions ) - case And(l @ _*) => + case And(l*) => val lR = l.map(boolExprToHelper) val keys = lR.foldLeft(allOf[TargetId].toSet)((acc, m) => acc.intersect(m.result.keySet) @@ -53,7 +53,7 @@ trait ExprCeciliaExporter { lR.map(_.subComponentAssertions).reduce(_ ++ _) ) - case Or(l @ _*) => + case Or(l*) => val lR = l.map(boolExprToHelper) val keys = lR.foldLeft(allOf[TargetId].toSet)((acc, m) => acc.intersect(m.result.keySet) diff --git a/src/main/scala/onera/pmlanalyzer/views/dependability/exporters/Folder.scala b/src/main/scala/onera/pmlanalyzer/views/dependability/exporters/Folder.scala index 8db6081..241d14a 100644 --- a/src/main/scala/onera/pmlanalyzer/views/dependability/exporters/Folder.scala +++ b/src/main/scala/onera/pmlanalyzer/views/dependability/exporters/Folder.scala @@ -151,7 +151,7 @@ final case class VersionFolder[T](parent: EntityFolder[T])(implicit case x: RecordType => "record" case x: EnumeratedType => "enum" case _ => "" - }) getOrElse ("") + }) getOrElse "" } def toElem: Elem = m.getVersionFamilyFlag match { case None => diff --git a/src/main/scala/onera/pmlanalyzer/views/dependability/exporters/Model.scala b/src/main/scala/onera/pmlanalyzer/views/dependability/exporters/Model.scala index ec7dc45..270c9d6 100644 --- a/src/main/scala/onera/pmlanalyzer/views/dependability/exporters/Model.scala +++ b/src/main/scala/onera/pmlanalyzer/views/dependability/exporters/Model.scala @@ -131,7 +131,7 @@ sealed trait Model { object Model { - def linksToElem(links: List[(Flow, Flow)]) = { + def linksToElem(links: List[(Flow, Flow)]): Seq[Elem] = { for { ((from, to), id) <- links.zipWithIndex oFrom <- from.owner diff --git a/src/main/scala/onera/pmlanalyzer/views/dependability/model/Software.scala b/src/main/scala/onera/pmlanalyzer/views/dependability/model/Software.scala index 83207d3..53dbfe5 100644 --- a/src/main/scala/onera/pmlanalyzer/views/dependability/model/Software.scala +++ b/src/main/scala/onera/pmlanalyzer/views/dependability/model/Software.scala @@ -90,10 +90,10 @@ class Descriptor[FM: IsCriticityOrdering: IsFinite] private ( for (loadStatus <- loadI.eval()) yield { val copies = transferts.map(t => t -> worst( - (t.targetNeeded + t.targetNeeded .map( loadStatus - )) + ) .toSeq: _* ) // TODO Raise error when the status cannot be computed => connection error ) diff --git a/src/main/scala/onera/pmlanalyzer/views/dependability/operators/IsMergeable.scala b/src/main/scala/onera/pmlanalyzer/views/dependability/operators/IsMergeable.scala index 3bb4df5..29d952c 100644 --- a/src/main/scala/onera/pmlanalyzer/views/dependability/operators/IsMergeable.scala +++ b/src/main/scala/onera/pmlanalyzer/views/dependability/operators/IsMergeable.scala @@ -18,8 +18,6 @@ package onera.pmlanalyzer.views.dependability.operators -import scala.language.higherKinds - trait IsMergeable[C[_, _]] { def mergeWith[K, V](first: C[K, V], that: C[K, V], f: (V, V) => V): C[K, V] }