feathersjs/feathers-generator

View on GitHub

Showing 38 of 88 total issues

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

                Function questions has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      const questions = metadata.meta.prompts.map(prompt => {
                        const question = Object.assign({}, prompt);
                
                        if (!prompt.name) {
                          throw new Error(`Invalid prompt. You must provide a 'name'. ${prompt}`);
                Severity: Minor
                Found in src/utils/ask.js - About 1 hr to fix

                  Function plugin has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function plugin (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 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export default function (options) {
                    
                      const debug = require('debug')(`feathers:service:${options.table}:postgres`)
                    
                      const model = client({
                    Severity: Minor
                    Found in src/service/templates/models/postgres/templates/service.model.js - About 1 hr to fix

                      Function rename has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

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

                        export default function (options) {
                        
                          const debug = require('debug')(`feathers:service:${options.table}:mysql`)
                        
                          const model = client({
                        Severity: Minor
                        Found in src/service/templates/models/mysql/templates/service.model.js - About 1 hr to fix

                          Function mount has 28 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 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default function (options) {
                            
                              const debug = require('debug')(`feathers:service:${options.table}:sqlite`)
                            
                              const model = client({
                            Severity: Minor
                            Found in src/service/templates/models/sqlite/templates/service.model.js - About 1 hr to fix

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

                              export default function (options) {
                                return function configuration (files, metalsmith, done) {
                                  const meta = metalsmith.metadata();
                                  const { whitelist } = meta.answers;
                                  const existing = meta.default;
                              Severity: Minor
                              Found in src/app/middleware/configuration.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 default has a Cognitive Complexity of 9 (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} = metadata.answers;
                              Severity: Minor
                              Found in src/repo/middleware/package-json.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 default has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export default function (paths) {
                                return function json (files, metalsmith, done) {
                                  const meta = metalsmith.metadata();
                              
                                  for (let key of Object.keys(paths)) {
                              Severity: Minor
                              Found in src/utils/json.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

                              Function middleware has a Cognitive Complexity of 7 (exceeds 5 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: Minor
                              Found in src/utils/mount.js - About 35 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

                              Severity
                              Category
                              Status
                              Source
                              Language