camilosampedro/Aton

View on GitHub

Showing 56 of 56 total issues

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

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

            getComputer(ip: number) {
                return this.http.get(`/api/computer/${ip}`).map(res=>res.json())
            }
        Severity: Major
        Found in app/assets/app/computer/computer.service.ts and 7 other locations - About 1 hr to fix
        app/assets/app/computer/computer.service.ts on lines 20..22
        app/assets/app/laboratory/laboratory.service.ts on lines 25..27
        app/assets/app/laboratory/laboratory.service.ts on lines 29..31
        app/assets/app/orderform/ssh-order.service.ts on lines 26..28
        app/assets/app/orderform/ssh-order.service.ts on lines 30..32
        app/assets/app/room/room.service.ts on lines 19..21
        app/assets/app/room/room.service.ts on lines 23..25

        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 56.

        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 8 locations. Consider refactoring.
        Open

            deleteLaboratory(id: number){
                return this.http.delete(`/api/laboratory/${id}`).map(res=>res.json());
            }
        Severity: Major
        Found in app/assets/app/orderform/ssh-order.service.ts and 7 other locations - About 1 hr to fix
        app/assets/app/computer/computer.service.ts on lines 20..22
        app/assets/app/computer/computer.service.ts on lines 24..26
        app/assets/app/laboratory/laboratory.service.ts on lines 25..27
        app/assets/app/laboratory/laboratory.service.ts on lines 29..31
        app/assets/app/orderform/ssh-order.service.ts on lines 30..32
        app/assets/app/room/room.service.ts on lines 19..21
        app/assets/app/room/room.service.ts on lines 23..25

        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 56.

        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 8 locations. Consider refactoring.
        Open

            deleteLaboratory(id: number){
                return this.http.delete(`/api/laboratory/${id}`).map(res=>res.json());
            }
        Severity: Major
        Found in app/assets/app/laboratory/laboratory.service.ts and 7 other locations - About 1 hr to fix
        app/assets/app/computer/computer.service.ts on lines 20..22
        app/assets/app/computer/computer.service.ts on lines 24..26
        app/assets/app/laboratory/laboratory.service.ts on lines 29..31
        app/assets/app/orderform/ssh-order.service.ts on lines 26..28
        app/assets/app/orderform/ssh-order.service.ts on lines 30..32
        app/assets/app/room/room.service.ts on lines 19..21
        app/assets/app/room/room.service.ts on lines 23..25

        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 56.

        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 8 locations. Consider refactoring.
        Open

            getLaboratory(id: number) {
                return this.http.get(`/api/laboratory/${id}`).map(res=>res.json())
            }
        Severity: Major
        Found in app/assets/app/laboratory/laboratory.service.ts and 7 other locations - About 1 hr to fix
        app/assets/app/computer/computer.service.ts on lines 20..22
        app/assets/app/computer/computer.service.ts on lines 24..26
        app/assets/app/laboratory/laboratory.service.ts on lines 25..27
        app/assets/app/orderform/ssh-order.service.ts on lines 26..28
        app/assets/app/orderform/ssh-order.service.ts on lines 30..32
        app/assets/app/room/room.service.ts on lines 19..21
        app/assets/app/room/room.service.ts on lines 23..25

        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 56.

        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 8 locations. Consider refactoring.
        Open

            deleteLaboratory(id: number){
                return this.http.delete(`/api/room/${id}`).map(res=>res.json());
            }
        Severity: Major
        Found in app/assets/app/room/room.service.ts and 7 other locations - About 1 hr to fix
        app/assets/app/computer/computer.service.ts on lines 20..22
        app/assets/app/computer/computer.service.ts on lines 24..26
        app/assets/app/laboratory/laboratory.service.ts on lines 25..27
        app/assets/app/laboratory/laboratory.service.ts on lines 29..31
        app/assets/app/orderform/ssh-order.service.ts on lines 26..28
        app/assets/app/orderform/ssh-order.service.ts on lines 30..32
        app/assets/app/room/room.service.ts on lines 23..25

        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 56.

        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 8 locations. Consider refactoring.
        Open

            getLaboratory(id: number) {
                return this.http.get(`/api/room/${id}`).map(res=>res.json())
            }
        Severity: Major
        Found in app/assets/app/room/room.service.ts and 7 other locations - About 1 hr to fix
        app/assets/app/computer/computer.service.ts on lines 20..22
        app/assets/app/computer/computer.service.ts on lines 24..26
        app/assets/app/laboratory/laboratory.service.ts on lines 25..27
        app/assets/app/laboratory/laboratory.service.ts on lines 29..31
        app/assets/app/orderform/ssh-order.service.ts on lines 26..28
        app/assets/app/orderform/ssh-order.service.ts on lines 30..32
        app/assets/app/room/room.service.ts on lines 19..21

        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 56.

        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 8 locations. Consider refactoring.
        Open

            deleteComputer(ip: number){
                return this.http.delete(`/api/computer/${ip}`).map(res=>res.json());
            }
        Severity: Major
        Found in app/assets/app/computer/computer.service.ts and 7 other locations - About 1 hr to fix
        app/assets/app/computer/computer.service.ts on lines 24..26
        app/assets/app/laboratory/laboratory.service.ts on lines 25..27
        app/assets/app/laboratory/laboratory.service.ts on lines 29..31
        app/assets/app/orderform/ssh-order.service.ts on lines 26..28
        app/assets/app/orderform/ssh-order.service.ts on lines 30..32
        app/assets/app/room/room.service.ts on lines 19..21
        app/assets/app/room/room.service.ts on lines 23..25

        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 56.

        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 8 locations. Consider refactoring.
        Open

            getLaboratory(id: number) {
                return this.http.get(`/api/laboratory/${id}`).map(res=>res.json())
            }
        Severity: Major
        Found in app/assets/app/orderform/ssh-order.service.ts and 7 other locations - About 1 hr to fix
        app/assets/app/computer/computer.service.ts on lines 20..22
        app/assets/app/computer/computer.service.ts on lines 24..26
        app/assets/app/laboratory/laboratory.service.ts on lines 25..27
        app/assets/app/laboratory/laboratory.service.ts on lines 29..31
        app/assets/app/orderform/ssh-order.service.ts on lines 26..28
        app/assets/app/room/room.service.ts on lines 19..21
        app/assets/app/room/room.service.ts on lines 23..25

        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 56.

        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 5 locations. Consider refactoring.
        Open

        package dao
        
        import com.google.inject.ImplementedBy
        import dao.impl.RoleDAOImpl
        import model.Role
        Severity: Major
        Found in app/dao/RoleDAO.scala and 4 other locations - About 1 hr to fix
        app/dao/ComputerStateDAO.scala on lines 1..53
        app/dao/SSHOrderDAO.scala on lines 1..51
        app/dao/SuggestionDAO.scala on lines 1..49
        app/dao/UserDAO.scala on lines 1..50

        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 91.

        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 5 locations. Consider refactoring.
        Open

        package dao
        
        import com.google.inject.ImplementedBy
        import dao.impl.SuggestionDAOImpl
        import model.Suggestion
        Severity: Major
        Found in app/dao/SuggestionDAO.scala and 4 other locations - About 1 hr to fix
        app/dao/ComputerStateDAO.scala on lines 1..53
        app/dao/RoleDAO.scala on lines 1..49
        app/dao/SSHOrderDAO.scala on lines 1..51
        app/dao/UserDAO.scala on lines 1..50

        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 91.

        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 5 locations. Consider refactoring.
        Open

        package dao
        
        import com.google.inject.ImplementedBy
        import dao.impl.UserDAOImpl
        import model.User
        Severity: Major
        Found in app/dao/UserDAO.scala and 4 other locations - About 1 hr to fix
        app/dao/ComputerStateDAO.scala on lines 1..53
        app/dao/RoleDAO.scala on lines 1..49
        app/dao/SSHOrderDAO.scala on lines 1..51
        app/dao/SuggestionDAO.scala on lines 1..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 91.

        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 5 locations. Consider refactoring.
        Open

        package dao
        
        import java.sql.Timestamp
        
        import com.google.inject.ImplementedBy
        Severity: Major
        Found in app/dao/SSHOrderDAO.scala and 4 other locations - About 1 hr to fix
        app/dao/ComputerStateDAO.scala on lines 1..53
        app/dao/RoleDAO.scala on lines 1..49
        app/dao/SuggestionDAO.scala on lines 1..49
        app/dao/UserDAO.scala on lines 1..50

        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 91.

        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 5 locations. Consider refactoring.
        Open

        package dao
        
        import java.sql.Timestamp
        
        import com.google.inject.ImplementedBy
        Severity: Major
        Found in app/dao/ComputerStateDAO.scala and 4 other locations - About 1 hr to fix
        app/dao/RoleDAO.scala on lines 1..49
        app/dao/SSHOrderDAO.scala on lines 1..51
        app/dao/SuggestionDAO.scala on lines 1..49
        app/dao/UserDAO.scala on lines 1..50

        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 91.

        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 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

                               id: Long,
                               sentDatetime: Timestamp,
                               superUser: Boolean,
                               interrupt: Boolean,
                               command: String,
          Severity: Minor
          Found in app/model/SSHOrder.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 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
                Severity
                Category
                Status
                Source
                Language