Gottwik/Enduro

View on GitHub

Showing 196 of 196 total issues

Function diff has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

juice_diff.prototype.diff = function (path1, path2) {

    let store_compare_result
    return dircompare.compare(path1, path2)
        .then((compare_result) => {
Severity: Minor
Found in libs/juicebox/juice_diff.js - About 1 hr to fix

    Function get_global_data has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    global_data.prototype.get_global_data = function () {
    
        // Constants
        const data_path = [enduro.project_path + '/cms/global/**/*.js', enduro.project_path + '/cms/.settings.js']
    
    
    Severity: Minor
    Found in libs/global_data.js - About 1 hr to fix

      Function verify_passphrase has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      trollhunter.prototype.verify_passphrase = function (passphrase) {
          return new Promise(function (resolve, reject) {
      
              if (!passphrase) {
                  return reject('no passphrase provided')
      Severity: Minor
      Found in libs/trollhunter.js - About 55 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

      Function traverse_offline has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      function traverse_offline (context, list_of_external_resources_to_download) {
          for (c in context) {
      
              if (typeof context[c] === 'string') {
                  links = parse_for_external_links(context[c])
      Severity: Minor
      Found in libs/remote_tools/offline_handler.js - About 55 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

      Function register has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      helper.prototype.register = function () {
      
          enduro.templating_engine.registerHelper('grouped_each', function (every, context, options) {
      
              if (!context || !(Object.keys(context).length || context.length)) {
      Severity: Minor
      Found in hbs_helpers/grouped_each.js - About 55 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

      Function get_ab_list has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      ab_tester.prototype.get_ab_list = function () {
          return page_queue_generator.get_all_pages()
              .then((pages) => {
      
                  // gets page list
      Severity: Minor
      Found in libs/ab_testing/ab_tester.js - About 55 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

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

          read_both_files_timestamps.push(flat.load(item.fullpath2, true)
              .then((context) => {
                  item.juicetimestamp2 = figure_out_timestamp(context)
              }))
      Severity: Minor
      Found in libs/juicebox/juice_diff.js and 1 other location - About 55 mins to fix
      libs/juicebox/juice_diff.js on lines 104..107

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

      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

          read_both_files_timestamps.push(flat.load(item.fullpath1, true)
              .then((context) => {
                  item.juicetimestamp1 = figure_out_timestamp(context)
              }))
      Severity: Minor
      Found in libs/juicebox/juice_diff.js and 1 other location - About 55 mins to fix
      libs/juicebox/juice_diff.js on lines 109..112

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

      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

      Function register has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      helper.prototype.register = function () {
      
          enduro.templating_engine.registerHelper('times', function (iterations, upperrange, block) {
      
              // will store the final accumulated html
      Severity: Minor
      Found in hbs_helpers/times.js - About 45 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

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

              return get_latest_juice()
                  .then((juice) => {
                      pull_juice = juice
                      return get_juicebox_by_name(juice.latest.hash + EXTENSION)
                  }, err)
      Severity: Minor
      Found in libs/juicebox/juicebox.js and 1 other location - About 45 mins to fix
      libs/juicebox/juicebox.js on lines 69..87

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

      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

              return get_latest_juice()
                  .then((juice) => {
                      pull_juice = juice
                      return get_juicebox_by_name(juice.latest.hash + EXTENSION)
                  }, err)
      Severity: Minor
      Found in libs/juicebox/juicebox.js and 1 other location - About 45 mins to fix
      libs/juicebox/juicebox.js on lines 53..63

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

      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

                  return flat_helpers.dir_exists(copy_from)
                      .then(() => {
                          return fs.copyAsync(copy_from, copy_to, { overwrite: true })
                      }, () => {})
      Severity: Minor
      Found in libs/build_tools/js_handler.js and 1 other location - About 40 mins to fix
      libs/build_tools/assets_copier.js on lines 125..128

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

      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

          return flat_helpers.dir_exists(copy_from)
              .then(() => {
                  return fs.copyAsync(copy_from, copy_to, { overwrite: true })
              }, () => {})
      Severity: Minor
      Found in libs/build_tools/assets_copier.js and 1 other location - About 40 mins to fix
      libs/build_tools/js_handler.js 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 49.

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

      require(['jquery'], function ($) {
          $(document).ready(function () {
              console.log('requirejs ready to use')
          })
      })
      Severity: Major
      Found in scaffolding/test_juicebox/assets/js/main.js and 6 other locations - About 35 mins to fix
      scaffolding/minimalistic/assets/js/main.js on lines 9..13
      scaffolding/test/assets/js/main.js on lines 9..13
      scaffolding/test_admin/assets/js/main.js on lines 9..13
      scaffolding/test_js/assets/js/main.js on lines 9..13
      scaffolding/test_performance/assets/js/main.js on lines 9..13
      scaffolding/test_stylus/assets/js/main.js on lines 9..13

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

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

      require(['jquery'], function ($) {
          $(document).ready(function () {
              console.log('requirejs ready to use')
          })
      })
      Severity: Major
      Found in scaffolding/test_admin/assets/js/main.js and 6 other locations - About 35 mins to fix
      scaffolding/minimalistic/assets/js/main.js on lines 9..13
      scaffolding/test/assets/js/main.js on lines 9..13
      scaffolding/test_js/assets/js/main.js on lines 9..13
      scaffolding/test_juicebox/assets/js/main.js on lines 9..13
      scaffolding/test_performance/assets/js/main.js on lines 9..13
      scaffolding/test_stylus/assets/js/main.js on lines 9..13

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

      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

          builder: (yargs) => {
              return yargs
                  .usage('enduro juice pull')
                  .options({
                      'force': {
      Severity: Minor
      Found in cli_commands/juice_commands/pull.js and 1 other location - About 35 mins to fix
      cli_commands/juice_commands/pack.js on lines 4..13

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

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

      require(['jquery'], function ($) {
          $(document).ready(function () {
              console.log('requirejs ready to use')
          })
      })
      Severity: Major
      Found in scaffolding/test_stylus/assets/js/main.js and 6 other locations - About 35 mins to fix
      scaffolding/minimalistic/assets/js/main.js on lines 9..13
      scaffolding/test/assets/js/main.js on lines 9..13
      scaffolding/test_admin/assets/js/main.js on lines 9..13
      scaffolding/test_js/assets/js/main.js on lines 9..13
      scaffolding/test_juicebox/assets/js/main.js on lines 9..13
      scaffolding/test_performance/assets/js/main.js on lines 9..13

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

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

      require(['jquery'], function ($) {
          $(document).ready(function () {
              console.log('requirejs ready to use')
          })
      })
      Severity: Major
      Found in scaffolding/minimalistic/assets/js/main.js and 6 other locations - About 35 mins to fix
      scaffolding/test/assets/js/main.js on lines 9..13
      scaffolding/test_admin/assets/js/main.js on lines 9..13
      scaffolding/test_js/assets/js/main.js on lines 9..13
      scaffolding/test_juicebox/assets/js/main.js on lines 9..13
      scaffolding/test_performance/assets/js/main.js on lines 9..13
      scaffolding/test_stylus/assets/js/main.js on lines 9..13

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

      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

          builder: (yargs) => {
              return yargs
                  .usage('enduro juice pack')
                  .options({
                      'force': {
      Severity: Minor
      Found in cli_commands/juice_commands/pack.js and 1 other location - About 35 mins to fix
      cli_commands/juice_commands/pull.js on lines 4..13

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

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

      require(['jquery'], function ($) {
          $(document).ready(function () {
              console.log('requirejs ready to use')
          })
      })
      Severity: Major
      Found in scaffolding/test/assets/js/main.js and 6 other locations - About 35 mins to fix
      scaffolding/minimalistic/assets/js/main.js on lines 9..13
      scaffolding/test_admin/assets/js/main.js on lines 9..13
      scaffolding/test_js/assets/js/main.js on lines 9..13
      scaffolding/test_juicebox/assets/js/main.js on lines 9..13
      scaffolding/test_performance/assets/js/main.js on lines 9..13
      scaffolding/test_stylus/assets/js/main.js on lines 9..13

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

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

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

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

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

      Refactorings

      Further Reading

      Severity
      Category
      Status
      Source
      Language