yoctore/yocto-config

View on GitHub

Showing 35 of 35 total issues

Function getExpress has 367 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Schema.prototype.getExpress = function () {
  // Default schema
  var schema = {
    // Default app rules
    app : joi.object().required().keys({
Severity: Major
Found in src/schema.js - About 1 day to fix

    File schema.js has 560 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    'use strict';
    
    var joi   = require('joi');
    var _     = require('lodash');
    var utils = require('yocto-utils');
    Severity: Major
    Found in src/schema.js - About 1 day to fix

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

          fingerprint : joi.object().optional().keys({
            enable     : joi.boolean().required().default(false),
            key        : joi.string().optional().default(this.uuid),
            dateFormat : joi.string().optional().default('DD/MM/YYYY'),
            qs         : joi.string().optional().empty().default('v'),
      Severity: Major
      Found in src/schema.js and 1 other location - About 6 hrs to fix
      src/schema.js on lines 594..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 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

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

          fingerprint : joi.object().optional().keys({
            enable     : joi.boolean().required().default(false),
            key        : joi.string().optional().default(this.uuid),
            dateFormat : joi.string().optional().default('DD/MM/YYYY'),
            qs         : joi.string().optional().empty().default('v'),
      Severity: Major
      Found in src/schema.js and 1 other location - About 6 hrs to fix
      src/schema.js on lines 615..621

      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

      Function getRender has 84 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Schema.prototype.getRender = function () {
        // Define meta rules
        var metaHttpEquivRules = joi.object().keys({
          name  : joi.string().required().not(null),
          value : joi.string().required().not(null)
      Severity: Major
      Found in src/schema.js - About 3 hrs to fix

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

            base64 : joi.object().optional().keys({
              enable : joi.boolean().required().default(false),
              qs     : joi.string().optional().empty().default('r')
            })
        Severity: Major
        Found in src/schema.js and 1 other location - About 2 hrs to fix
        src/schema.js on lines 622..625

        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

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

            base64 : joi.object().optional().keys({
              enable : joi.boolean().required().default(false),
              qs     : joi.string().optional().empty().default('r')
            })
        Severity: Major
        Found in src/schema.js and 1 other location - About 2 hrs to fix
        src/schema.js on lines 601..604

        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

          var mediaTypeRules = {
            css : joi.array().optional().min(1).items(cssMediaRules),
            js  : joi.array().optional().min(1).items(jsMediaRules)
          };
        Severity: Major
        Found in src/schema.js and 1 other location - About 2 hrs to fix
        src/schema.js on lines 635..638

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

          var assetsRules = {
            header : joi.object().optional().min(1).keys(mediaTypeRules),
            footer : joi.object().optional().min(1).keys(mediaTypeRules)
          };
        Severity: Major
        Found in src/schema.js and 1 other location - About 2 hrs to fix
        src/schema.js on lines 629..632

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

                $('.parent').each(function() {
                  // mapping
                  if ($(this).find('.thide').length === $(this).find('.child').length) {
                    $(this).hide();
                  }
        Severity: Major
        Found in docs/scripts/search.js and 1 other location - About 2 hrs to fix
        docs/scripts/search.js on lines 31..36

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

        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

                $('.parent').each(function() {
                  // mapping
                  if ($(this).find('.thide').length !== $(this).find('.child').length) {
                    $(this).show();
                  }
        Severity: Major
        Found in docs/scripts/search.js and 1 other location - About 2 hrs to fix
        docs/scripts/search.js on lines 22..27

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

        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

                otherwise : joi.object().required().keys({
                  key  : joi.string().required().empty(),
                  cert : joi.string().required().empty()
                })
        Severity: Major
        Found in src/schema.js and 1 other location - About 2 hrs to fix
        src/schema.js on lines 519..522

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

        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

            urls       : joi.object().required().keys({
              connect  : joi.string().required().empty(),
              callback : joi.string().required().empty()
            }),
        Severity: Major
        Found in src/schema.js and 1 other location - About 2 hrs to fix
        src/schema.js on lines 344..347

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

        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 load has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Config.prototype.load = function () {
          // Create async process here
          var deferred = Q.defer();
        
          // Any errors ?? try/catch it
        Severity: Major
        Found in src/index.js - About 2 hrs to fix

          Function exports has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function (grunt) {
            // Init config
            grunt.initConfig({
              // Default package
              pkg : grunt.file.readJSON('package.json'),
          Severity: Minor
          Found in Gruntfile.js - About 2 hrs to fix

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

                      policy : joi.object().default({
                        'default-src' : 'none',
                        'script-src'  : '\'self\'',
                        'object-src'  : '\'self\'',
                        'style-src'   : '\'self\'',
            Severity: Major
            Found in src/schema.js and 1 other location - About 2 hrs to fix
            src/schema.js on lines 234..252

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

            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

                      policy : {
                        'default-src' : 'none',
                        'script-src'  : '\'self\'',
                        'object-src'  : '\'self\'',
                        'style-src'   : '\'self\'',
            Severity: Major
            Found in src/schema.js and 1 other location - About 2 hrs to fix
            src/schema.js on lines 255..273

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

            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 getMongoose has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Schema.prototype.getMongoose = function () {
              // Native parser. Exclude it because underscore keys is not a good practicies and hint failed
              // transformation will process at the end
              var nParser = {
                nativeParser : joi.boolean().default(false)
            Severity: Minor
            Found in src/schema.js - About 1 hr to fix

              Function getPassportJs has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Schema.prototype.getPassportJs = function () {
                // Default validation schema
                var baseSchema = {
                  identifier : joi.string().required().empty().default(null),
                  secret     : joi.string().required().empty(),
              Severity: Minor
              Found in src/schema.js - About 1 hr to fix

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

                  var facebookTwitterKeys = {
                    property : joi.string().required().empty(),
                    content  : joi.string().required().empty()
                  };
                Severity: Major
                Found in src/schema.js and 1 other location - About 1 hr to fix
                src/schema.js on lines 647..650

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

                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