feathersjs/feathers-generator

View on GitHub

Showing 38 of 88 total issues

Function default has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

export default function (options) {
  return function ask (files, metalsmith, done) {
    const metadata = metalsmith.metadata();
    const data = Object.assign({}, metadata);

Severity: Minor
Found in src/utils/ask.js - About 2 hrs 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 middleware has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    Function default has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function (options) {
    
      return function feathersJSON (files, metalsmith, done) {
        const meta = metalsmith.metadata();
        const { name, providers, cors, whitelist } = meta.answers;
    Severity: Minor
    Found in src/app/middleware/feathers-json.js - About 2 hrs 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 mount has 63 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: Major
    Found in src/utils/mount.js - About 2 hrs to fix

      Function default has a Cognitive Complexity of 17 (exceeds 5 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 2 hrs 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 default has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function (options) {
      
        return function feathersJSON (files, metalsmith, done) {
          const meta = metalsmith.metadata();
          const { name, providers, cors, whitelist } = meta.answers;
      Severity: Major
      Found in src/app/middleware/feathers-json.js - About 2 hrs to fix

        Function feathersJSON has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          return function feathersJSON (files, metalsmith, done) {
            const meta = metalsmith.metadata();
            const { name, providers, cors, whitelist } = meta.answers;
            const existing = meta.feathers;
            let template = files['src/feathers.json'];
        Severity: Major
        Found in src/app/middleware/feathers-json.js - About 2 hrs to fix

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

          export default function (options) {
            return function ask (files, metalsmith, done) {
              const metadata = metalsmith.metadata();
              const data = Object.assign({}, metadata);
          
          
          Severity: Minor
          Found in src/utils/ask.js - About 1 hr to fix

            Function default has 47 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/app/generator.js - About 1 hr to fix

              Function ask has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                return function ask (files, metalsmith, done) {
                  const metadata = metalsmith.metadata();
                  const data = Object.assign({}, metadata);
              
                  try {
              Severity: Minor
              Found in src/utils/ask.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 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/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/filter/generator.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 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 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 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
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language