LearnPAd/learnpad

View on GitHub
lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/MySqlController.java

Summary

Maintainability
F
1 wk
Test Coverage

File MySqlController.java has 683 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package eu.learnpad.simulator.mon.storage;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;

    MySqlController has 51 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class MySqlController implements DBController {
    
        private Properties connectionProp;
        private Connection conn;      
        private PreparedStatement preparedStmt;

      Method connectToDB has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          @Override
          public boolean connectToDB() {
              String url = "jdbc:mysql://"
                      + connectionProp.getProperty("database.host") +
                      ":" + connectionProp.getProperty("database.port")+"/";

        Method updateBpmnLearnerScores has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            @Override
            public void updateBpmnLearnerScores(String learnerID, String idBPMN, float learnerBPScore,
                    float learnerRelativeBPScore, float learnerCoverage) {
                String query;
                try {

          Method getOrSetLearners has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              @Override
              public Vector<Learner> getOrSetLearners(List<String> learnersIDs) {
                  Vector<Learner> learners = new Vector<Learner>();
                  String query;
                  Learner aLearner;

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

                public void updateBpmnLearnerScores(String learnerID, String idBPMN, float learnerBPScore,
                        float learnerRelativeBPScore, float learnerCoverage) {

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

                  public int setLearnerSessionScore(String idLearner, String idPath, String idBPMN, float sessionScore, java.sql.Date scoreUpdatingDate) {

                Avoid too many return statements within this method.
                Open

                        return true;

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

                      @Override
                      public Vector<Learner> getOrSetLearners(List<String> learnersIDs) {
                          Vector<Learner> learners = new Vector<Learner>();
                          String query;
                          Learner aLearner;
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 391..423

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

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

                      @Override
                      public Vector<Float> getMaxSessionScores(String learnerID, String idBPMN) {
                          
                          String query = "SELECT max(session_score)"
                                  + " FROM glimpse.path_learner"
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 602..626

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

                  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

                      @Override
                      public Vector<Path> getBPMNPaths(String idBPMN) {
                          String query = "select * from path where id_bpmn = \'"+idBPMN+"';";
                          Vector<Path> retrievedPath = new Vector<Path>();
                          
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 79..103

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

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

                      @Override
                      public Learner getLearner(String idLearner) {
                          String query = "select * from glimpse.learner where id_learner = \'"+idLearner+"';";
                          Learner theLearnerGathered = null;
                          
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 207..229

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

                  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

                      @Override
                      public int saveLearnerProfile(Learner theLearner) {
                          String query = "insert into learner"
                                  + "(id_learner, id_role, global_score, relative_global_score, absolute_global_score)"
                                  + " values (?, ?, ?, ?, ?)";
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 181..205

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

                  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

                      @Override
                      public int saveBPMN(Bpmn theBPMN) {
                  
                            String query = " insert into bpmn (id_bpmn, extraction_date, id_category, absolute_bp_score, paths_cardinality)"
                                      + " values (?, ?, ?, ?, ?) ";
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 134..158

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

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

                      @Override
                      public Vector<Float> getLearnerBPMNScores(String learnerID) {
                          String query = "SELECT bp_score " + " FROM bpmn_learner"
                                  + " where id_learner = " + learnerID + "";
                          Vector<Float> retrievedScores = new Vector<Float>();
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 514..531
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 557..577
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 579..600
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/MySqlController.java on lines 580..600
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/MySqlController.java on lines 602..623

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

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

                      @Override
                      public Vector<Float> getLearnerRelativeBPScores(String learnerID) {
                          String query = "SELECT relative_bp_score "
                                  + " FROM glimpse.bpmn_learner" 
                                  + " where id_learner = '" + learnerID +
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 514..531
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 557..577
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 579..600
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/MySqlController.java on lines 537..554
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/MySqlController.java on lines 602..623

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

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

                      @Override
                      public Vector<Float> getBPMNScoresExecutedByLearner(String learnerID) {
                          String query = "SELECT bpmn_learner.bp_score"
                                  + " FROM glimpse.bpmn, glimpse.bpmn_learner" + " where bpmn_learner.id_learner = '" + learnerID + "'";
                  
                  
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 514..531
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 557..577
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 579..600
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/MySqlController.java on lines 537..554
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/MySqlController.java on lines 580..600

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

                  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

                      @Override
                      public int setLearnerSessionScore(String idLearner, String idPath, String idBPMN, float sessionScore, java.sql.Date scoreUpdatingDate) {
                            String query = " insert into path_learner (id_learner, id_path, id_bpmn, session_score, execution_date)"
                                      + " values (?, ?, ?, ?, ?) ";
                          try {
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 110..132

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

                  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

                      @Override
                      public int getBPMNPathsCardinality(String idBPMN) {
                          String query = "SELECT COUNT(*) FROM path where id_bpmn = \'"+idBPMN+"';";
                          int result = 0;
                  
                  
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 741..762

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

                  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

                      @Override
                      public int setLearnerBPScore(String idLearner, String idBPMN, float BPScore) {
                           String query = " insert into bpmn_learner (id_learner, id_bpmn, bp_score, relative_bp_score, bp_coverage)"
                                      + " values (?, ?, ?, ?. ?)";
                               
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 354..377

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

                  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

                      @Override
                      public boolean checkIfBPHasBeenAlreadyExtracted(String idBPMN) {
                          String query = "select * from path where id_bpmn = \'"+idBPMN+"';";
                              
                          try {
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 309..328

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

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

                      @Override
                      public void setLearnerGlobalScore(String learnerID, float learnerGlobalScore) {
                           String query = " update glimpse.learner set global_score = "+
                                               learnerGlobalScore + ";";
                               
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 461..480

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

                  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

                                          else {
                                               query = " insert into bpmn_learner (id_learner, id_bpmn, bp_score, relative_bp_score, bp_coverage)"
                                                          + " values (?, ?, ?, ?, ?)";
                                                  preparedStmt = conn.prepareStatement(query);
                  
                  
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 720..733

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

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

                      @Override
                      public void setLearnerAbsoluteGlobalScore(String learnerID, float absoluteGlobalScore) {
                           String query = " update glimpse.learner set absolute_global_score = "+
                                   absoluteGlobalScore + ";";
                       
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 482..496
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 498..512
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/MySqlController.java on lines 505..519

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

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

                      @Override
                      public void setLearnerRelativeGlobalScore(String learnerID, float learnerRelativeGlobalScore) {
                           String query = " update glimpse.learner set relative_global_score = "+
                                   learnerRelativeGlobalScore + ";";
                       
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 482..496
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 498..512
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/MySqlController.java on lines 521..535

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

                  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

                                          if (resultsSet.first()) {
                                              
                                              query = "update learner set global_score = "+
                                              learnerGlobalScore + ",  relative_global_score = "+
                                                      learnerRelativeGlobalScore + ", absolute_global_score = "+
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/MySqlController.java on lines 721..733

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

                  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

                                          if (resultsSet.first()) {
                                              
                                              query = "update bpmn_learner set bp_score = "+
                                              learnerBPScore + ",  relative_bp_score = "+
                                                      learnerRelativeBPScore + ", bp_coverage = "+
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/MySqlController.java on lines 688..700

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

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

                      @Override
                      public Vector<Path> savePathsForBPMN(Vector<Path> vector) {
                  
                          for (int i = 0; i<vector.size(); i++) {
                              savePath(vector.get(i));
                  lp-simulation-environment/monitoring/src/main/java/eu/learnpad/simulator/mon/storage/H2Controller.java on lines 425..432

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

                  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

                  There are no issues that match your filters.

                  Category
                  Status