belsrc/vue-gen

View on GitHub

Showing 23 of 25 total issues

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

const main = async () => {
  const cmdInput = program
    .version(packageFile.version)
    .usage('[component] [destination] [options]')
    .option('--file [file type]', 'type of file [jsx | sfc]')
Severity: Minor
Found in vue-gen.js - About 2 hrs to fix

    Function main has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    const main = async () => {
      const cmdInput = program
        .version(packageFile.version)
        .usage('[component] [destination] [options]')
        .option('--file [file type]', 'type of file [jsx | sfc]')
    Severity: Minor
    Found in vue-gen.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

    Function exports has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    module.exports = function({ name, file, component, state, functional, typescript }) {
      const nameQuestion = {
        type: 'input',
        name: 'name',
        message: 'Component name?',
    Severity: Minor
    Found in src/questions.js - About 25 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 genContent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    const genContent = (fileType, componentName, className, isPage, hasState, functional, typescript) =>
      fileType === '.jsx' || fileType === '.tsx' ?
        functional ?
          jsxFnFile(componentName, className) :
          jsxFile(componentName, className, isPage, hasState, typescript) :
    Severity: Minor
    Found in src/get-content.js - About 25 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

    Parsing error: The keyword 'const' is reserved
    Open

    const path = require('path');
    Severity: Minor
    Found in src/test-path.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: The keyword 'const' is reserved
    Open

    const genFnVue = (compName, className) => `<script>
    Severity: Minor
    Found in src/blueprints/vue-func-file.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: The keyword 'const' is reserved
    Open

    const fjp = require('fjp');
    Severity: Minor
    Found in src/write-gen-files.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: The keyword 'const' is reserved
    Open

    const genVue = (compName, className, isPage, hasState, isTs) => `${
    Severity: Minor
    Found in src/blueprints/vue-file.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: The keyword 'const' is reserved
    Open

    const fjp = require('fjp');
    Severity: Minor
    Found in src/utils/kebab-case.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: The keyword 'const' is reserved
    Open

    const fs = require('fs');
    Severity: Minor
    Found in src/utils/write-file.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: The keyword 'const' is reserved
    Open

    const genJsx = (compName, className, isPage, hasState, isTs) => `import './styles.scss';
    Severity: Minor
    Found in src/blueprints/jsx-file.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: The keyword 'const' is reserved
    Open

    const fs = require('fs');
    Severity: Minor
    Found in src/utils/make-dir.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: The keyword 'const' is reserved
    Open

    const genScss = className => `// Mobile / Baseline
    Severity: Minor
    Found in src/blueprints/scss-file.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: The keyword 'const' is reserved
    Open

    const path = require('path');
    Severity: Minor
    Found in src/get-styles.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: The keyword 'const' is reserved
    Open

    const path = require('path');
    Severity: Minor
    Found in src/generate.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: The keyword 'const' is reserved
    Open

    const genTest = (componentName, compFile, isFunctional) => `import '@babel/register';
    Severity: Minor
    Found in src/blueprints/test-file.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: The keyword 'const' is reserved
    Open

    const fs = require('fs');
    Severity: Minor
    Found in src/utils/check-dir.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: The keyword 'const' is reserved
    Open

    const fjp = require('fjp');
    Severity: Minor
    Found in src/utils/quiet-params.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: The keyword 'const' is reserved
    Open

    const program = require('commander');
    Severity: Minor
    Found in vue-gen.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: Unexpected token {
    Open

    module.exports = function({ name, file, component, state, functional, typescript }) {
    Severity: Minor
    Found in src/questions.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Severity
    Category
    Status
    Source
    Language