Showing 15 of 56 total issues
File SSHOrderServiceImpl.scala
has 300 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
package services.impl
import java.io.{BufferedReader, IOException, InputStreamReader}
import java.net.NoRouteToHostException
import java.sql.Timestamp
Function executeWithSudoWorkaround
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private def executeWithSudoWorkaround(sshOrder: SSHOrder, settings: SSHOptions): (String,Int) = {
play.Logger.debug(s"""Trying sudo workaround with $sshOrder""")
settings.password.password match {
case Some(password) =>
val jsch = new JSch()
Function get
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def get(id: Long): Future[Option[(Laboratory, Map[Room, Seq[(Computer, Option[(ComputerState, Seq[ConnectedUser])])]])]] = {
// Access to database using the laboratory's DAO
laboratoryDAO.getWithChildren(id).map { res =>
// res will have a sequence of (laboratory, room, computer, computerState, connectedUser)
// Then group it by its first element: Laboratory
Function executeUntilResult
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def executeUntilResult(computer: Computer, sshOrders: Seq[SSHOrder]): (String, Int) = {
play.Logger.debug(s"""Executing: $sshOrders into: $computer""")
val joinedSSHOrder = sshOrders.headOption match {
case Some(sshOrder) =>
sshOrder.copy(command = sshOrders.map(_.command).mkString(" & "))
Function checkState
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
override def checkState(computer: Computer)(implicit username: String): StateRef = {
val sSHOrder = new SSHOrder(now, false, false, dummy, username)
val settings = generateSSHSettings(computer, sSHOrder)
try {
val result = jassh.SSH.shell(settings){ shell =>
Function submit
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
submit(){
this._computer = new Computer();
this._computer.ip = this.ip;
this._computer.name = this.name;
this._computer.description = this.description;
Function onReceive
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
override def onReceive(message: Any): Unit = {
// Only execute when it's not executing.
if (!isExecuting) {
// Set flag. It starts to execute now.
Constructor has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
ip: String,
name: Option[String],
SSHUser: String,
SSHPassword: String,
description: Option[String],
Constructor has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
id: Long,
sentDatetime: Timestamp,
superUser: Boolean,
interrupt: Boolean,
command: String,
Constructor has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
class ComputerChecker @Inject()(connectedUserDAO: ConnectedUserDAO, computerStateDAO: ComputerStateDAO, computerService: ComputerService, sSHOrderService: SSHOrderService, actorSystem: ActorSystem, executionContext: ExecutionContext) extends UntypedActor with Timer {
Constructor has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
ip: String,
name: Option[String],
SSHUser: String,
SSHPassword: String,
description: Option[String],
Constructor has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
ip: String,
name: Option[String],
SSHUser: String,
SSHPassword: String,
description: Option[String],
Method add
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
override def add(ip: String, name: Option[String], sSHUser: String, sSHPassword: String, description: Option[String], roomID: Option[Long]): Future[ActionState] = {
Constructor has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
computerIp: String,
registeredDate: java.sql.Timestamp,
state: Int,
operatingSystem: Option[String],
mac: Option[String])
Constructor has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
computerIp: String,
sshOrderId: Long,
sshOrderDatetime: Timestamp,
result: Option[String],
exitCode: Option[Int]) {