Skip to content

Commit

Permalink
Manual refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-delmas committed Dec 13, 2024
1 parent 7fe575a commit ee044f8
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions src/main/scala/onera/pmlanalyzer/pml/operators/Merge.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down
5 changes: 0 additions & 5 deletions src/main/scala/onera/pmlanalyzer/pml/operators/Use.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
Expand Down

0 comments on commit ee044f8

Please sign in to comment.