feathersjs/feathers-generator

View on GitHub

Showing 88 of 88 total issues

Function default has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function (prompt, done, options) {
  const metalsmith = Metalsmith(TEMPLATE_PATH);
  const SERVICE_PATH = path.resolve(options.path);
  const FEATHERS_PATH = 'src/feathers.json';
  const MOUNT_PATH = options.mount || 'src/feathers.json';
Severity: Minor
Found in src/middleware/generator.js - About 1 hr to fix

    Function default has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function (prompt, done, options) {
      const metalsmith = Metalsmith(TEMPLATE_PATH);
      const SERVICE_PATH = path.resolve(options.path);
      const FEATHERS_PATH = 'src/feathers.json';
      const MOUNT_PATH = options.mount || 'src/feathers.json';
    Severity: Minor
    Found in src/filter/generator.js - About 1 hr to fix

      Function default has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function (prompt, done, options) {
        const metalsmith = Metalsmith(TEMPLATE_PATH);
        const SERVICE_PATH = path.resolve(options.path);
        const FEATHERS_PATH = 'src/feathers.json';
        const MOUNT_PATH = options.mount || 'src/feathers.json';
      Severity: Minor
      Found in src/plugin/generator.js - About 1 hr to fix

        Function default has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function (prompt, done, options) {
          const metalsmith = Metalsmith(TEMPLATE_PATH);
          const SERVICE_PATH = path.resolve(options.path);
          const FEATHERS_PATH = 'src/feathers.json';
          const MOUNT_PATH = options.mount || 'src/feathers.json';
        Severity: Minor
        Found in src/hook/generator.js - About 1 hr to fix

          Function default has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function (prompt, done, options) {
            const metalsmith = Metalsmith(TEMPLATE_PATH);
          
            metalsmith
              .metadata({ options })
          Severity: Minor
          Found in src/repo/generator.js - About 1 hr to fix

            Function default has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function (options) {
              return function packageJSON (files, metalsmith, done) {
                const metadata = metalsmith.metadata();
                const {name, description} = metadata.options;
                const {babel, providers, cors} = metadata.answers;
            Severity: Minor
            Found in src/app/middleware/package-json.js - About 1 hr to fix

              Function hooks has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function hooks (options) {
                return function mount (files, metalsmith, done) {
                  // if not mounting, skip
                  if (!options.mount) {
                    return done(null);
              Severity: Minor
              Found in src/utils/mount.js - About 1 hr to fix

                Function packageJSON has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  return function packageJSON (files, metalsmith, done) {
                    const metadata = metalsmith.metadata();
                    const {name, description} = metadata.options;
                    const {babel, providers, cors} = metadata.answers;
                    const meta = metadata.meta;
                Severity: Minor
                Found in src/app/middleware/package-json.js - About 1 hr to fix

                  Function mount has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    return function mount (files, metalsmith, done) {
                      // if not mounting, skip
                      if (!options.mount) {
                        return done(null);
                      }
                  Severity: Minor
                  Found in src/utils/mount.js - About 1 hr to fix

                    Function default has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export default function (prompt, done, options) {
                      const metalsmith = Metalsmith(TEMPLATE_PATH);
                      const MOUNT_PATH = options.mount || 'src/feathers.json';
                      const CONFIG_PATH = options.config || 'config';
                    
                    
                    Severity: Minor
                    Found in src/service/generator.js - About 1 hr to fix

                      Function default has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default function (options) {
                        return function packageJSON (files, metalsmith, done) {
                          const metadata = metalsmith.metadata();
                          const {name, description} = metadata.options;
                          const {babel} = metadata.answers;
                      Severity: Minor
                      Found in src/repo/middleware/package-json.js - About 1 hr to fix

                        Function filter has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function filter (options) {
                          return function mount (files, metalsmith, done) {
                            // if not mounting, skip
                            if (!options.mount) {
                              return done(null);
                        Severity: Minor
                        Found in src/utils/mount.js - About 1 hr to fix

                          Function packageJSON has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            return function packageJSON (files, metalsmith, done) {
                              const metadata = metalsmith.metadata();
                              const {name, description} = metadata.options;
                              const {babel} = metadata.answers;
                              const meta = metadata.meta;
                          Severity: Minor
                          Found in src/repo/middleware/package-json.js - About 1 hr to fix

                            Function mount has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              return function mount (files, metalsmith, done) {
                                // if not mounting, skip
                                if (!options.mount) {
                                  return done(null);
                                }
                            Severity: Minor
                            Found in src/utils/mount.js - About 1 hr to fix

                              Function default has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export default function (options) {
                                return function mount (files, metalsmith, done) {
                                  const meta = metalsmith.metadata();
                              
                                  let model = meta.answers.model.template;
                              Severity: Minor
                              Found in src/service/middleware/model.js - About 1 hr to fix

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

                                  return function mount (files, metalsmith, done) {
                                    const meta = metalsmith.metadata();
                                
                                    let model = meta.answers.model.template;
                                    let deps = meta.answers.model.deps;
                                Severity: Minor
                                Found in src/service/middleware/model.js - About 1 hr to fix

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

                                  export function services (options) {
                                    return function rename (files, metalsmith, done) {
                                      const meta = metalsmith.metadata();
                                  
                                      // if generating standalone and this is default service, use index
                                  Severity: Minor
                                  Found in src/utils/rename.js - About 1 hr to fix

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

                                    export default function() {
                                    
                                      var env = process.env.NODE_ENV;
                                      var dir = env === 'production' ? 'lib' : 'src';
                                    
                                    
                                    Severity: Major
                                    Found in examples/repo/src/index/index.js and 5 other locations - About 1 hr to fix
                                    examples/filter/src/index/index.js on lines 1..7
                                    examples/hook/src/index/index.js on lines 1..7
                                    examples/plugin/src/index/index.js on lines 1..7
                                    examples/service/src/index/index.js on lines 1..7
                                    src/repo/templates/src/index/index.js on lines 1..7

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 60.

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                        connection: {
                                          host : options.host || '127.0.0.1',
                                          user : options.user || user,
                                          password : options.pass || '', // this needs to be a better way
                                          database: options.db || 'feathers'
                                    src/service/templates/models/mysql/templates/service.model.js on lines 11..16

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 60.

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                    export default function() {
                                    
                                      var env = process.env.NODE_ENV;
                                      var dir = env === 'production' ? 'lib' : 'src';
                                    
                                    
                                    Severity: Major
                                    Found in examples/hook/src/index/index.js and 5 other locations - About 1 hr to fix
                                    examples/filter/src/index/index.js on lines 1..7
                                    examples/plugin/src/index/index.js on lines 1..7
                                    examples/repo/src/index/index.js on lines 1..7
                                    examples/service/src/index/index.js on lines 1..7
                                    src/repo/templates/src/index/index.js on lines 1..7

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 60.

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

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

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

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

                                    Refactorings

                                    Further Reading

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language