gerard2p/node-mce

View on GitHub

Showing 15 of 15 total issues

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

async function createProjectExtructure(application: string, opt: Parsed<typeof options>) {
    let {author} = opt
    await spin('Creating Files', async () => {
        // istanbul ignore else
        if(author === 'GIT_OR_NPM_USER') {
Severity: Minor
Found in src/commands/new.ts - About 2 hrs to fix

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

    export function SyncFiles(patterns: string[], outDir = './lib') {
        const localPackage = new PackageJSON(callerPath('package.json'))
        const bins = Object.keys(localPackage.bin).map(bin => localPackage.bin[bin]).map(bin => `${sync(bin)}:.`)
        patterns = [
            'templates/**/*:.',
    Severity: Minor
    Found in src/commands/build/sync.ts - About 1 hr to fix

      Function UseSourceMaps has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export async function UseSourceMaps(error: Error) {
          const showInternal = process.env.MCE_TRACE_SHOWINTERNAL === 'true'
          const showMCE = process.env.MCE_TRACE_SHOWMCE === 'true'
          const stack = error.stack.split('\n')
          const parsed = stack.filter(line => {
      Severity: Minor
      Found in src/@utils/user-sourcemaps.ts - About 1 hr to fix

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

        function detectChanges(outDir: string, baseDir: string) {
            sourcesTo.clear()
            const {program: {fileInfos}} = JSON.parse(readFileSync('./incremental.tsbuildinfo', 'utf-8')) as { program: { fileInfos: fileInfos}}
            const preCompiled = Object.keys(fileInfos).filter(f => !f.includes('node_modules'))
            const compiled = preCompiled.map(o => {
        Severity: Minor
        Found in src/commands/build/incremental.ts - About 1 hr to fix

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

          export function warn(text: TemplateStringsArray, ...values: any[]) {
              log(1)`{warning|sy|yellow} ${tagcompiler(text, ...values)}`
          }
          Severity: Major
          Found in src/console.ts and 5 other locations - About 55 mins to fix
          src/console.ts on lines 73..75
          src/console.ts on lines 79..81
          src/console.ts on lines 82..84
          src/console.ts on lines 85..87
          src/console.ts on lines 88..90

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

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

          export function error(text: TemplateStringsArray, ...values: any[]) {
              log(0)`{error|sy|red} ${tagcompiler(text, ...values)}`
          }
          Severity: Major
          Found in src/console.ts and 5 other locations - About 55 mins to fix
          src/console.ts on lines 73..75
          src/console.ts on lines 76..78
          src/console.ts on lines 82..84
          src/console.ts on lines 85..87
          src/console.ts on lines 88..90

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

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

          export function created(text: TemplateStringsArray, ...values: any[]) {
              log(0)`{success|sy|blueBright} ${tagcompiler(text, ...values)}`
          }
          Severity: Major
          Found in src/console.ts and 5 other locations - About 55 mins to fix
          src/console.ts on lines 73..75
          src/console.ts on lines 76..78
          src/console.ts on lines 79..81
          src/console.ts on lines 82..84
          src/console.ts on lines 85..87

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

          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

              const {program: {fileInfos}} = JSON.parse(readFileSync('./incremental.tsbuildinfo', 'utf-8')) as { program: { fileInfos: fileInfos}}
          Severity: Minor
          Found in src/commands/build/incremental.ts and 1 other location - About 55 mins to fix
          src/commands/build/incremental.ts on lines 19..19

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

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

          export function range(...args: [string, string, RegExp | Range, Range?]) {
              return preOptions<Range>(Parser.range, ...args)
          }
          Severity: Major
          Found in src/core/options.ts and 2 other locations - About 55 mins to fix
          src/core/options.ts on lines 139..141
          src/core/options.ts on lines 153..155

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

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

          export function ok(text: TemplateStringsArray, ...values: any[]) {
              log(0)`{success|sy|green} ${tagcompiler(text, ...values)}`
          }
          Severity: Major
          Found in src/console.ts and 5 other locations - About 55 mins to fix
          src/console.ts on lines 73..75
          src/console.ts on lines 76..78
          src/console.ts on lines 79..81
          src/console.ts on lines 85..87
          src/console.ts on lines 88..90

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

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

          export function info(text: TemplateStringsArray, ...values: any[]) {
              log(2)`{info|sy|cyan} ${tagcompiler(text, ...values)}`
          }
          Severity: Major
          Found in src/console.ts and 5 other locations - About 55 mins to fix
          src/console.ts on lines 76..78
          src/console.ts on lines 79..81
          src/console.ts on lines 82..84
          src/console.ts on lines 85..87
          src/console.ts on lines 88..90

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

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

          export function updated(text: TemplateStringsArray, ...values: any[]) {
              log(0)`{updated|sy|blueBright} ${tagcompiler(text, ...values)}`
          }
          Severity: Major
          Found in src/console.ts and 5 other locations - About 55 mins to fix
          src/console.ts on lines 73..75
          src/console.ts on lines 76..78
          src/console.ts on lines 79..81
          src/console.ts on lines 82..84
          src/console.ts on lines 88..90

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

          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

              const {program: {fileInfos}} = JSON.parse(readFileSync('./incremental.tsbuildinfo', 'utf-8')) as { program: { fileInfos: fileInfos}}
          Severity: Minor
          Found in src/commands/build/incremental.ts and 1 other location - About 55 mins to fix
          src/commands/build/incremental.ts on lines 33..33

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

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

          export function collect(...args: [string, string, RegExp | List, List?]) {
              return preOptions<List>(Parser.collect, ...args)
          }
          Severity: Major
          Found in src/core/options.ts and 2 other locations - About 55 mins to fix
          src/core/options.ts on lines 111..113
          src/core/options.ts on lines 139..141

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

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

          export function list(...args: [string, string, RegExp | List, List?]) {
              return preOptions<List>(Parser.list, ...args)
          }
          Severity: Major
          Found in src/core/options.ts and 2 other locations - About 55 mins to fix
          src/core/options.ts on lines 111..113
          src/core/options.ts on lines 153..155

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

          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