camilosampedro/Aton

View on GitHub

Showing 56 of 56 total issues

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

      Identical blocks of code found in 3 locations. Consider refactoring.
      Open

          implicit val (username: Option[String], isAdmin: Boolean) = loggedIn match {
            case Some(user) => (Some(user.username), user.role == Role.Administrator)
            case _ => (None, false)
          }
      Severity: Major
      Found in app/controllers/SuggestionController.scala and 2 other locations - About 45 mins to fix
      app/controllers/LaboratoryController.scala on lines 25..28
      app/controllers/SuggestionController.scala on lines 37..40

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 74.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 3 locations. Consider refactoring.
      Open

          implicit val (username: Option[String], isAdmin: Boolean) = loggedIn match {
            case Some(user) => (Some(user.username), user.role == Role.Administrator)
            case _ => (None, false)
          }
      Severity: Major
      Found in app/controllers/LaboratoryController.scala and 2 other locations - About 45 mins to fix
      app/controllers/SuggestionController.scala on lines 21..24
      app/controllers/SuggestionController.scala on lines 37..40

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 74.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 3 locations. Consider refactoring.
      Open

          implicit val (username: Option[String], isAdmin: Boolean) = loggedIn match {
            case Some(user) => (Some(user.username), user.role == Role.Administrator)
            case _ => (None, false)
          }
      Severity: Major
      Found in app/controllers/SuggestionController.scala and 2 other locations - About 45 mins to fix
      app/controllers/LaboratoryController.scala on lines 25..28
      app/controllers/SuggestionController.scala on lines 21..24

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 74.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          .on((computerWithState,connectedUser)=>
            computerWithState._2.map(_.computerIp) === connectedUser.computerStateComputerIp
              && computerWithState._2.map(_.registeredDate) === connectedUser.computerStateRegisteredDate)
      Severity: Minor
      Found in app/dao/impl/ComputerDAOImpl.scala and 1 other location - About 45 mins to fix
      app/dao/impl/LaboratoryDAOImpl.scala on lines 49..49

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 73.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          } joinLeft computers on { (x, y) => x._2.map(_.id) === y.roomId } joinLeft computerStates on { (x, y) => x._2.map(_.ip) === y.computerIp } joinLeft connectedUsers on { (x, y) => x._2.map(_.computerIp) === y.computerStateComputerIp && x._2.map(_.registeredDate) === y.computerStateRegisteredDate }
      Severity: Minor
      Found in app/dao/impl/LaboratoryDAOImpl.scala and 1 other location - About 45 mins to fix
      app/dao/impl/ComputerDAOImpl.scala on lines 45..47

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 73.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

              case JsSuccess(room, _) => roomService.add(room).map {
                case state.ActionCompleted => Ok(Json.toJson(new ResultMessage("Room added")))
                case _ => BadRequest(Json.toJson(new ResultMessage("Could not add that room")))
              }
      Severity: Minor
      Found in app/controllers/admin/RoomController.scala and 1 other location - About 40 mins to fix
      app/controllers/admin/LaboratoryController.scala on lines 47..51

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 70.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                laboratoryService.add(newLaboratory).map {
                  case state.ActionCompleted => Ok(Json.toJson(new ResultMessage("Laboratory added")))
                  case _ => BadRequest(Json.toJson(new ResultMessage("Could not add that laboratory")))
      
                }
      Severity: Minor
      Found in app/controllers/admin/LaboratoryController.scala and 1 other location - About 40 mins to fix
      app/controllers/admin/RoomController.scala on lines 25..28

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 70.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              tripleJoin
                .map(x=>
                  (x._1._1,x._1._2,x._2)
                ).filter(_._1.ip === ip)
                .result
          Severity: Minor
          Found in app/dao/impl/ComputerDAOImpl.scala and 1 other location - About 35 mins to fix
          app/dao/impl/ComputerDAOImpl.scala on lines 147..149

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 67.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              tripleJoin.map(x=>
                (x._1._1,x._1._2,x._2)
              ).filter(_._1.ip inSet binded).result
          Severity: Minor
          Found in app/dao/impl/ComputerDAOImpl.scala and 1 other location - About 35 mins to fix
          app/dao/impl/ComputerDAOImpl.scala on lines 131..135

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 67.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

          package model.form
          
          import model.form.data.RoomFormData
          import play.api.data.Form
          import play.api.data.Forms._
          Severity: Minor
          Found in app/model/form/RoomForm.scala and 2 other locations - About 35 mins to fix
          app/model/form/LoginForm.scala on lines 1..18
          app/model/form/SSHOrderForm.scala on lines 1..18

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 67.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

          package model.form
          
          import model.json.LoginJson
          import play.api.data.Form
          import play.api.data.Forms._
          Severity: Minor
          Found in app/model/form/LoginForm.scala and 2 other locations - About 35 mins to fix
          app/model/form/RoomForm.scala on lines 1..18
          app/model/form/SSHOrderForm.scala on lines 1..18

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 67.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

          package model.form
          
          import model.form.data.SSHOrderFormData
          import play.api.data.Form
          import play.api.data.Forms._
          Severity: Minor
          Found in app/model/form/SSHOrderForm.scala and 2 other locations - About 35 mins to fix
          app/model/form/LoginForm.scala on lines 1..18
          app/model/form/RoomForm.scala on lines 1..18

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 67.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Severity
          Category
          Status
          Source
          Language