camilosampedro/Aton

View on GitHub

Showing 15 of 56 total issues

File SSHOrderServiceImpl.scala has 300 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package services.impl

import java.io.{BufferedReader, IOException, InputStreamReader}
import java.net.NoRouteToHostException
import java.sql.Timestamp
Severity: Minor
Found in app/services/impl/SSHOrderServiceImpl.scala - About 3 hrs to fix

    Function executeWithSudoWorkaround has 66 lines of code (exceeds 25 allowed). Consider refactoring.
    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()
    Severity: Major
    Found in app/services/impl/SSHOrderServiceImpl.scala - About 2 hrs to fix

      Function get has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      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
      Severity: Minor
      Found in app/services/impl/LaboratoryServiceImpl.scala - About 1 hr to fix

        Function executeUntilResult has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        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(" & "))
        Severity: Minor
        Found in app/services/impl/SSHOrderServiceImpl.scala - About 1 hr to fix

          Function checkState has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          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 =>
          Severity: Minor
          Found in app/services/impl/SSHOrderServiceImpl.scala - About 1 hr to fix

            Function submit has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                submit(){
                    this._computer = new Computer();
                    this._computer.ip = this.ip;
                    this._computer.name = this.name;
                    this._computer.description = this.description;
            Severity: Minor
            Found in app/assets/app/computer/formpanel/computer-form-panel.component.ts - About 1 hr to fix

              Function onReceive has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                override def onReceive(message: Any): Unit = {
                  // Only execute when it's not executing.
                  if (!isExecuting) {
              
                    // Set flag. It starts to execute now.
              Severity: Minor
              Found in app/config/ComputerChecker.scala - About 1 hr to fix

                Constructor has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                                             ip: String,
                                             name: Option[String],
                                             SSHUser: String,
                                             SSHPassword: String,
                                             description: Option[String],
                Severity: Minor
                Found in app/model/form/data/ComputerFormData.scala - About 45 mins to fix

                  Constructor has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                                       id: Long,
                                       sentDatetime: Timestamp,
                                       superUser: Boolean,
                                       interrupt: Boolean,
                                       command: String,
                  Severity: Minor
                  Found in app/model/SSHOrder.scala - About 45 mins to fix

                    Constructor has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    class ComputerChecker @Inject()(connectedUserDAO: ConnectedUserDAO, computerStateDAO: ComputerStateDAO, computerService: ComputerService, sSHOrderService: SSHOrderService, actorSystem: ActorSystem, executionContext: ExecutionContext) extends UntypedActor with Timer {
                    Severity: Minor
                    Found in app/config/ComputerChecker.scala - About 45 mins to fix

                      Constructor has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                                           ip: String,
                                           name: Option[String],
                                           SSHUser: String,
                                           SSHPassword: String,
                                           description: Option[String],
                      Severity: Minor
                      Found in app/model/Computer.scala - About 45 mins to fix

                        Constructor has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                                     ip: String,
                                                     name: Option[String],
                                                     SSHUser: String,
                                                     SSHPassword: String,
                                                     description: Option[String],
                        Severity: Minor
                        Found in app/model/json/ComputerJson.scala - About 45 mins to fix

                          Method add has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                            override def add(ip: String, name: Option[String], sSHUser: String, sSHPassword: String, description: Option[String], roomID: Option[Long]): Future[ActionState] = {
                          Severity: Minor
                          Found in app/services/impl/ComputerServiceImpl.scala - About 45 mins to fix

                            Constructor has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                                      computerIp: String,
                                                      registeredDate: java.sql.Timestamp,
                                                      state: Int,
                                                      operatingSystem: Option[String],
                                                      mac: Option[String])
                            Severity: Minor
                            Found in app/model/ComputerState.scala - About 35 mins to fix

                              Constructor has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                                             computerIp: String,
                                                             sshOrderId: Long,
                                                             sshOrderDatetime: Timestamp,
                                                             result: Option[String],
                                                             exitCode: Option[Int]) {
                              Severity: Minor
                              Found in app/model/SSHOrderToComputer.scala - About 35 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language