ucberkeley/moocchat

View on GitHub

Showing 132 of 132 total issues

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

  protected void printHelp() {
    formatter.printHelp(LoadHITs.class.getName()
        + " -" + ARG_INPUT + " [input_file]"
        + " -" + ARG_QUESTION + " [question_file]"
        + " -" + ARG_PROPERTIES + " [properties_file]", opt);
Severity: Major
Found in turk/src/com/amazonaws/mturk/cmd/LoadHITs.java and 4 other locations - About 40 mins to fix
turk/src/com/amazonaws/mturk/cmd/CreateQualificationType.java on lines 60..66
turk/src/com/amazonaws/mturk/cmd/ExtendHITs.java on lines 51..57
turk/src/com/amazonaws/mturk/cmd/RevokeQualification.java on lines 38..43
turk/src/com/amazonaws/mturk/cmd/UpdateQualificationScore.java on lines 44..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 51.

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

    protected void initOptions() {
      opt.addOption(ARG_QUALTYPE, true, "(required) Qualification Type Id whose score you want to update" );
      opt.addOption(WORKER_ID, true, "(required) WorkerId you want to update the score" );
      opt.addOption(SCORE, true, "(required) Score to be set for the Qualification" );
      opt.addOption(INPUT_FILE, true, "The input file to use (in comma-delimited format).This should contain the 'workerid' and 'score' columns");
Severity: Major
Found in turk/src/com/amazonaws/mturk/cmd/UpdateQualificationScore.java and 4 other locations - About 40 mins to fix
turk/src/com/amazonaws/mturk/cmd/CreateQualificationType.java on lines 49..58
turk/src/com/amazonaws/mturk/cmd/DeleteHITs.java on lines 43..52
turk/src/com/amazonaws/mturk/cmd/GetResults.java on lines 71..80
turk/src/com/amazonaws/mturk/cmd/GrantBonus.java on lines 33..42

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

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

  protected void printHelp() {
    formatter.printHelp(ExtendHITs.class.getName() 
        + " -" + ARG_SUCCESSFILE + " [path to success file]"
        + " -" + ARG_ASSIGNMENTS + " [assignments to add]"
        + " -" + ARG_HOURS + " [time in hours to extend the expiration date]",
Severity: Major
Found in turk/src/com/amazonaws/mturk/cmd/ExtendHITs.java and 4 other locations - About 40 mins to fix
turk/src/com/amazonaws/mturk/cmd/CreateQualificationType.java on lines 60..66
turk/src/com/amazonaws/mturk/cmd/LoadHITs.java on lines 75..80
turk/src/com/amazonaws/mturk/cmd/RevokeQualification.java on lines 38..43
turk/src/com/amazonaws/mturk/cmd/UpdateQualificationScore.java on lines 44..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 51.

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

    protected void printHelp() {
      formatter.printHelp(RevokeQualification.class.getName() + 
          " -" + ARG_WORKERID + " [worker to be revoked]" +
          " -" + ARG_QUALTYPE + " [qual to revoke]" +
          " -" + ARG_REASON + " [reason for revocation]", opt);
Severity: Major
Found in turk/src/com/amazonaws/mturk/cmd/RevokeQualification.java and 4 other locations - About 40 mins to fix
turk/src/com/amazonaws/mturk/cmd/CreateQualificationType.java on lines 60..66
turk/src/com/amazonaws/mturk/cmd/ExtendHITs.java on lines 51..57
turk/src/com/amazonaws/mturk/cmd/LoadHITs.java on lines 75..80
turk/src/com/amazonaws/mturk/cmd/UpdateQualificationScore.java on lines 44..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 51.

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

  protected void initOptions() {
    opt.addOption(ARG_SUCCESSFILE, true,
    "(required) A path to the success file returned by the call to LoadHITs");
    opt.addOption(ARG_FORCE, false,
    "(optional) Do not prompt for confirmation (DANGEROUS)");
Severity: Major
Found in turk/src/com/amazonaws/mturk/cmd/DeleteHITs.java and 4 other locations - About 40 mins to fix
turk/src/com/amazonaws/mturk/cmd/CreateQualificationType.java on lines 49..58
turk/src/com/amazonaws/mturk/cmd/GetResults.java on lines 71..80
turk/src/com/amazonaws/mturk/cmd/GrantBonus.java on lines 33..42
turk/src/com/amazonaws/mturk/cmd/UpdateQualificationScore.java on lines 37..42

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

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

  protected void initOptions() {
    opt.addOption(ARG_QUESTION, true, 
      "(optional) Path to the file containing the question");
    opt.addOption(ARG_PROPERTIES, true, 
      "(required) Path to the file containing the properties for the qualification");
Severity: Major
Found in turk/src/com/amazonaws/mturk/cmd/CreateQualificationType.java and 4 other locations - About 40 mins to fix
turk/src/com/amazonaws/mturk/cmd/DeleteHITs.java on lines 43..52
turk/src/com/amazonaws/mturk/cmd/GetResults.java on lines 71..80
turk/src/com/amazonaws/mturk/cmd/GrantBonus.java on lines 33..42
turk/src/com/amazonaws/mturk/cmd/UpdateQualificationScore.java on lines 37..42

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

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

  protected void printHelp() {
    formatter.printHelp(CreateQualificationType.class.getName() 
        + " -" + ARG_QUESTION + " [path to question file] "
        + " -" + ARG_PROPERTIES + " [path to properties file] "
        + "(-" + ARG_ANSWER + " [path to answer file])",
Severity: Major
Found in turk/src/com/amazonaws/mturk/cmd/CreateQualificationType.java and 4 other locations - About 40 mins to fix
turk/src/com/amazonaws/mturk/cmd/ExtendHITs.java on lines 51..57
turk/src/com/amazonaws/mturk/cmd/LoadHITs.java on lines 75..80
turk/src/com/amazonaws/mturk/cmd/RevokeQualification.java on lines 38..43
turk/src/com/amazonaws/mturk/cmd/UpdateQualificationScore.java on lines 44..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 51.

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

    protected void printHelp() {
      formatter.printHelp(UpdateQualificationScore.class.getName() +
          " -" + ARG_QUALTYPE + " [QualTypeId] " +
          " -" + WORKER_ID + " [WorkerId] " +
          " -" + SCORE + " [Score] ",opt);
Severity: Major
Found in turk/src/com/amazonaws/mturk/cmd/UpdateQualificationScore.java and 4 other locations - About 40 mins to fix
turk/src/com/amazonaws/mturk/cmd/CreateQualificationType.java on lines 60..66
turk/src/com/amazonaws/mturk/cmd/ExtendHITs.java on lines 51..57
turk/src/com/amazonaws/mturk/cmd/LoadHITs.java on lines 75..80
turk/src/com/amazonaws/mturk/cmd/RevokeQualification.java on lines 38..43

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

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

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

  private static void generateScript(String scriptTemplateDir, String target, 
      String targetDirPath, String command, CreateScriptUtil.ScriptType type) throws Exception {
Severity: Minor
Found in turk/src/com/amazonaws/mturk/cmd/MakeTemplate.java - About 35 mins to fix

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

      public void updateQualificationType( String qualTypeId, String statusString,
          String questionFile, String answerFile, 
          String propertiesFile ) throws Exception
    Severity: Minor
    Found in turk/src/com/amazonaws/mturk/cmd/UpdateQualificationType.java - About 35 mins to fix

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

            log.info(AssignQualification.class.getName() + 
                " -" + ARG_INPUT_FILE + " [ input file containing Qualification Type] " +
                " -" + ARG_SCORE_FILE + " [ score file ] " + 
                " -" + ARG_SCORE + " [value to grant]");
      Severity: Minor
      Found in turk/src/com/amazonaws/mturk/cmd/AssignQualification.java and 1 other location - About 35 mins to fix
      turk/src/com/amazonaws/mturk/cmd/AssignQualification.java on lines 49..52

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

      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

            log.info(AssignQualification.class.getName() + 
                " -" + ARG_QUALTYPE + " [qual to grant] " + 
                " -" + ARG_WORKERID + " [worker to be granted]" + 
                " -" + ARG_SCORE + " [value to grant]");
      Severity: Minor
      Found in turk/src/com/amazonaws/mturk/cmd/AssignQualification.java and 1 other location - About 35 mins to fix
      turk/src/com/amazonaws/mturk/cmd/AssignQualification.java on lines 54..57

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

      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

      Method generateScripts has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          private static void generateScripts(List<String> commands, String scriptDir, CreateScriptUtil.ScriptType type)
              throws Exception
          {
              for (String command : commands) {
                  if (type == null) { // All
      Severity: Minor
      Found in turk/src/com/amazonaws/mturk/build/CreateScripts.java - About 35 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method grantQualRequests has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        private void grantQualRequests(String[] qualReqs, Integer[] values) {
          
          // If we're not given anything, just no-op
          if (qualReqs == null) {
            return;
      Severity: Minor
      Found in turk/src/com/amazonaws/mturk/cmd/GrantQualificationRequests.java - About 35 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method eventlog_sessions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        def eventlog_sessions(eventlog)
          result = []
          eventlog_ordered = eventlog.joins(:task).order('tasks.original_chat_group', :created_at)
          current_session = []
          prev_orig_chat_group = nil
      Severity: Minor
      Found in app/controllers/reports_controller.rb - About 35 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method extractQuestion has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public static Map<String, String> extractQuestion(Map<String, List<String[]>> hitAssignments, int questionIndex) {
              Map<String, String> hitQuestions = new LinkedHashMap<String, String>();
              for(Map.Entry<String, List<String[]>> hitResults : hitAssignments.entrySet()){
                  String hitId = hitResults.getKey();
                  List<String[]> assignmentsDetails = hitResults.getValue();
      Severity: Minor
      Found in turk/src/com/amazonaws/mturk/cmd/summary/SummaryUtils.java - About 35 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method copyTemplateFile has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        private void copyTemplateFile(String sourceRoot, String targetRoot, String extension) throws Exception {
          String inputFileName = sourceRoot + extension;
          String outputFileName = targetRoot + extension;
          
          System.out.println("Copying resource file: " + outputFileName);
      Severity: Minor
      Found in turk/src/com/amazonaws/mturk/cmd/MakeTemplate.java - About 35 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method parseHitAssignments has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public static Map<String, List<String[]>> parseHitAssignments(
                  String resultsFile, String[] requiredFields, int[] fieldIndicesPlaceholder, char fieldSeparator) {
      
              Map<String, List<String[]>> hitAssignments = new LinkedHashMap<String, List<String[]>>();
              try {
      Severity: Minor
      Found in turk/src/com/amazonaws/mturk/cmd/summary/SummaryUtils.java - About 35 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method printHelp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        protected void printHelp() {   
          StringBuffer templTypesStr = new StringBuffer("");
          TemplateType[] templTypes = TemplateType.values();
          for(int i=0; i<templTypes.length; i++) {
            TemplateType type = templTypes[i];
      Severity: Minor
      Found in turk/src/com/amazonaws/mturk/cmd/MakeTemplate.java - About 35 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method getResults has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        public void getResults(String successFile, String outputFile,
            String answerPrefix) throws Exception {
          HITDataInput success = new HITDataCSVReader(successFile); 
          rowCount = success.getNumRows()-1;
          
      Severity: Minor
      Found in turk/src/com/amazonaws/mturk/cmd/GetResults.java - About 35 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Severity
      Category
      Status
      Source
      Language