Cloud-CV/EvalAI

View on GitHub
gulpfile.js

Summary

Maintainability
F
6 days
Test Coverage

File gulpfile.js has 253 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var gulp = require('gulp'),
    del = require('del'),
    _ = require('lodash'),
    fs = require('fs'),
    path = require('path'),
Severity: Minor
Found in gulpfile.js - About 2 hrs to fix

    Function js has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function js() {
        var app = gulp.src('frontend/src/js/app.js')
            .pipe(concat('app.js'))
            .pipe(gulp_if(production, rename({ suffix: '.min' })))
            .pipe(gulp_if(production, uglify({ mangle: false })))
    Severity: Minor
    Found in gulpfile.js - About 1 hr to fix

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

      function vendorcss() {
          var paths = [];
          _.forIn(styles.chunks, function(chunkStyles, chunkName) {
              chunkStyles.forEach(function(style) {
                  var styleFileName = styles.paths[style];
      Severity: Major
      Found in gulpfile.js and 1 other location - About 6 hrs to fix
      gulpfile.js on lines 38..54

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

      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

      function vendorjs() {
          var paths = [];
          _.forIn(scripts.chunks, function(chunkScripts, chunkName) {
              chunkScripts.forEach(function(script) {
                  var scriptFileName = scripts.paths[script];
      Severity: Major
      Found in gulpfile.js and 1 other location - About 6 hrs to fix
      gulpfile.js on lines 59..75

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

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

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

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

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

      Refactorings

      Further Reading

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

      function configDev() {
          return gulp.src('frontend/src/js/config.sample.js')
              .pipe(replace('moduleName', 'evalai-config'))
              .pipe(replace('constantName', Object.keys(configJson.local)))
              .pipe(replace('configKey', Object.keys(configJson.local.EnvironmentConfig)))
      Severity: Major
      Found in gulpfile.js and 2 other locations - About 6 hrs to fix
      gulpfile.js on lines 180..191
      gulpfile.js on lines 196..207

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

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

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

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

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

      Refactorings

      Further Reading

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

      function configStaging() {
          return gulp.src('frontend/src/js/config.sample.js')
              .pipe(replace('moduleName', 'evalai-config'))
              .pipe(replace('constantName', Object.keys(configJson.staging)))
              .pipe(replace('configKey', Object.keys(configJson.staging.EnvironmentConfig)))
      Severity: Major
      Found in gulpfile.js and 2 other locations - About 6 hrs to fix
      gulpfile.js on lines 180..191
      gulpfile.js on lines 212..223

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

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

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

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

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

      Refactorings

      Further Reading

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

      function configProd() {
          return gulp.src('frontend/src/js/config.sample.js')
              .pipe(replace('moduleName', 'evalai-config'))
              .pipe(replace('constantName', Object.keys(configJson.production)))
              .pipe(replace('configKey', Object.keys(configJson.production.EnvironmentConfig)))
      Severity: Major
      Found in gulpfile.js and 2 other locations - About 6 hrs to fix
      gulpfile.js on lines 196..207
      gulpfile.js on lines 212..223

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

      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

          var configs = gulp.src('frontend/src/js/route-config/*.js')
              .pipe(concat('route-config.js'))
              .pipe(gulp_if(production, rename({ suffix: '.min' })))
              .pipe(gulp_if(production, uglify({ mangle: false })))
              .pipe(gulp.dest('frontend/dist/js'));
      Severity: Major
      Found in gulpfile.js and 5 other locations - About 2 hrs to fix
      gulpfile.js on lines 96..100
      gulpfile.js on lines 108..112
      gulpfile.js on lines 114..118
      gulpfile.js on lines 120..124
      gulpfile.js on lines 126..130

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

      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

          var app = gulp.src('frontend/src/js/app.js')
              .pipe(concat('app.js'))
              .pipe(gulp_if(production, rename({ suffix: '.min' })))
              .pipe(gulp_if(production, uglify({ mangle: false })))
              .pipe(gulp.dest('frontend/dist/js'));
      Severity: Major
      Found in gulpfile.js and 5 other locations - About 2 hrs to fix
      gulpfile.js on lines 102..106
      gulpfile.js on lines 108..112
      gulpfile.js on lines 114..118
      gulpfile.js on lines 120..124
      gulpfile.js on lines 126..130

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

      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

          var filters = gulp.src('frontend/src/js/filters/*.js')
              .pipe(concat('filters.js'))
              .pipe(gulp_if(production, rename({ suffix: '.min' })))
              .pipe(gulp_if(production, uglify({ mangle: false })))
              .pipe(gulp.dest('frontend/dist/js'));
      Severity: Major
      Found in gulpfile.js and 5 other locations - About 2 hrs to fix
      gulpfile.js on lines 96..100
      gulpfile.js on lines 102..106
      gulpfile.js on lines 108..112
      gulpfile.js on lines 114..118
      gulpfile.js on lines 126..130

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

      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

          var services = gulp.src('frontend/src/js/services/*.js')
              .pipe(concat('services.js'))
              .pipe(gulp_if(production, rename({ suffix: '.min' })))
              .pipe(gulp_if(production, uglify({ mangle: false })))
              .pipe(gulp.dest('frontend/dist/js'))
      Severity: Major
      Found in gulpfile.js and 5 other locations - About 2 hrs to fix
      gulpfile.js on lines 96..100
      gulpfile.js on lines 102..106
      gulpfile.js on lines 108..112
      gulpfile.js on lines 114..118
      gulpfile.js on lines 120..124

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

      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

          var controllers = gulp.src('frontend/src/js/controllers/*.js')
              .pipe(concat('controllers.js'))
              .pipe(gulp_if(production, rename({ suffix: '.min' })))
              .pipe(gulp_if(production, uglify({ mangle: false })))
              .pipe(gulp.dest('frontend/dist/js'));
      Severity: Major
      Found in gulpfile.js and 5 other locations - About 2 hrs to fix
      gulpfile.js on lines 96..100
      gulpfile.js on lines 102..106
      gulpfile.js on lines 114..118
      gulpfile.js on lines 120..124
      gulpfile.js on lines 126..130

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

      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

          var directives = gulp.src('frontend/src/js/directives/*.js')
              .pipe(concat('directives.js'))
              .pipe(gulp_if(production, rename({ suffix: '.min' })))
              .pipe(gulp_if(production, uglify({ mangle: false })))
              .pipe(gulp.dest('frontend/dist/js'))
      Severity: Major
      Found in gulpfile.js and 5 other locations - About 2 hrs to fix
      gulpfile.js on lines 96..100
      gulpfile.js on lines 102..106
      gulpfile.js on lines 108..112
      gulpfile.js on lines 120..124
      gulpfile.js on lines 126..130

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

      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

      gulp.task('staging', gulp.series(clean, function(done) {
          production = true;
          done();
      }, parallelTasks, configStaging, injectpaths, replacetimestamp, lint));
      Severity: Minor
      Found in gulpfile.js and 1 other location - About 30 mins to fix
      gulpfile.js on lines 325..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 45.

      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

      gulp.task('production', gulp.series(clean, function(done) {
          production = true;
          done();
      }, parallelTasks, configProd, injectpaths, replacetimestamp, lint));
      Severity: Minor
      Found in gulpfile.js and 1 other location - About 30 mins to fix
      gulpfile.js on lines 330..333

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

      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