Oluwasegun-AA/md-generator

View on GitHub
src/index.ts

Summary

Maintainability
B
5 hrs
Test Coverage

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

program
  .command('check [env]')
  .description('check for missing .md files')
  .option('-O, --optional', 'check all optional files')
  .option('-R, --required', 'check all required files')
Severity: Major
Found in src/index.ts and 1 other location - About 1 hr to fix
src/index.ts on lines 14..21

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

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

program
  .command('list [env]')
  .description('list All Required/optional .md files')
  .option('-O --optional', 'list all optional files')
  .option('-R --required', 'list all required files')
Severity: Major
Found in src/index.ts and 1 other location - About 1 hr to fix
src/index.ts on lines 35..42

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

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

program
  .command('remove [env]')
  .description('remove All/specific .md files')
  .option('-A, --all', 'remove all .md files')
  .option('-O, --optional', 'remove all optional files')
Severity: Major
Found in src/index.ts and 1 other location - About 1 hr to fix
src/index.ts on lines 23..30

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

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

program
  .command('create [env]')
  .description('create All/specific files')
  .option('-O, --optional', 'create all optional files')
  .option('-R, --required', 'create all required files')
Severity: Major
Found in src/index.ts and 1 other location - About 1 hr to fix
src/index.ts on lines 44..53

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

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

variable name must be in lowerCamelCase or UPPER_CASE
Open

  .action((_type: any, args: any) => {
Severity: Minor
Found in src/index.ts by tslint

Rule: variable-name

Checks variable names for various errors.

Config

Several arguments may be optionally provided:

  • "check-format" enbables enforcement of a certain naming format. By default, the rule only allows only lowerCamelCased or UPPER_CASED variable names.
    • These additional options make the check stricter:
    • "require-const-for-all-caps": enforces that all variables with UPPER_CASED names should be const.
    • These additional options make the check more permissive:
    • "allow-leading-underscore" allows underscores at the beginning (only has an effect if "check-format" specified)
    • "allow-pascal-case" allows PascalCase in addition to lowerCamelCase.
    • "allow-snake-case" allows snake_case in addition to lowerCamelCase.
    • "allow-trailing-underscore" allows underscores at the end. (only has an effect if "check-format" specified)
  • "ban-keywords": disallows the use of certain TypeScript keywords as variable or parameter names.
    • These are: any, Number, number, String, string, Boolean, boolean, Undefined, undefined
Examples
"variable-name": [object Object]
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "check-format",
      "allow-leading-underscore",
      "allow-pascal-case",
      "allow-snake-case",
      "allow-trailing-underscore",
      "require-const-for-all-caps",
      "ban-keywords"
    ]
  },
  "minLength": 0,
  "maxLength": 6
}

For more information see this page.

variable name must be in lowerCamelCase or UPPER_CASE
Open

  .action((_type: any, args: any) => {
Severity: Minor
Found in src/index.ts by tslint

Rule: variable-name

Checks variable names for various errors.

Config

Several arguments may be optionally provided:

  • "check-format" enbables enforcement of a certain naming format. By default, the rule only allows only lowerCamelCased or UPPER_CASED variable names.
    • These additional options make the check stricter:
    • "require-const-for-all-caps": enforces that all variables with UPPER_CASED names should be const.
    • These additional options make the check more permissive:
    • "allow-leading-underscore" allows underscores at the beginning (only has an effect if "check-format" specified)
    • "allow-pascal-case" allows PascalCase in addition to lowerCamelCase.
    • "allow-snake-case" allows snake_case in addition to lowerCamelCase.
    • "allow-trailing-underscore" allows underscores at the end. (only has an effect if "check-format" specified)
  • "ban-keywords": disallows the use of certain TypeScript keywords as variable or parameter names.
    • These are: any, Number, number, String, string, Boolean, boolean, Undefined, undefined
Examples
"variable-name": [object Object]
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "check-format",
      "allow-leading-underscore",
      "allow-pascal-case",
      "allow-snake-case",
      "allow-trailing-underscore",
      "require-const-for-all-caps",
      "ban-keywords"
    ]
  },
  "minLength": 0,
  "maxLength": 6
}

For more information see this page.

variable name must be in lowerCamelCase or UPPER_CASE
Open

  .action((_type: any, args: any) => {
Severity: Minor
Found in src/index.ts by tslint

Rule: variable-name

Checks variable names for various errors.

Config

Several arguments may be optionally provided:

  • "check-format" enbables enforcement of a certain naming format. By default, the rule only allows only lowerCamelCased or UPPER_CASED variable names.
    • These additional options make the check stricter:
    • "require-const-for-all-caps": enforces that all variables with UPPER_CASED names should be const.
    • These additional options make the check more permissive:
    • "allow-leading-underscore" allows underscores at the beginning (only has an effect if "check-format" specified)
    • "allow-pascal-case" allows PascalCase in addition to lowerCamelCase.
    • "allow-snake-case" allows snake_case in addition to lowerCamelCase.
    • "allow-trailing-underscore" allows underscores at the end. (only has an effect if "check-format" specified)
  • "ban-keywords": disallows the use of certain TypeScript keywords as variable or parameter names.
    • These are: any, Number, number, String, string, Boolean, boolean, Undefined, undefined
Examples
"variable-name": [object Object]
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "check-format",
      "allow-leading-underscore",
      "allow-pascal-case",
      "allow-snake-case",
      "allow-trailing-underscore",
      "require-const-for-all-caps",
      "ban-keywords"
    ]
  },
  "minLength": 0,
  "maxLength": 6
}

For more information see this page.

variable name must be in lowerCamelCase or UPPER_CASE
Open

  .action((_type: any, args: any) => {
Severity: Minor
Found in src/index.ts by tslint

Rule: variable-name

Checks variable names for various errors.

Config

Several arguments may be optionally provided:

  • "check-format" enbables enforcement of a certain naming format. By default, the rule only allows only lowerCamelCased or UPPER_CASED variable names.
    • These additional options make the check stricter:
    • "require-const-for-all-caps": enforces that all variables with UPPER_CASED names should be const.
    • These additional options make the check more permissive:
    • "allow-leading-underscore" allows underscores at the beginning (only has an effect if "check-format" specified)
    • "allow-pascal-case" allows PascalCase in addition to lowerCamelCase.
    • "allow-snake-case" allows snake_case in addition to lowerCamelCase.
    • "allow-trailing-underscore" allows underscores at the end. (only has an effect if "check-format" specified)
  • "ban-keywords": disallows the use of certain TypeScript keywords as variable or parameter names.
    • These are: any, Number, number, String, string, Boolean, boolean, Undefined, undefined
Examples
"variable-name": [object Object]
Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "enum": [
      "check-format",
      "allow-leading-underscore",
      "allow-pascal-case",
      "allow-snake-case",
      "allow-trailing-underscore",
      "require-const-for-all-caps",
      "ban-keywords"
    ]
  },
  "minLength": 0,
  "maxLength": 6
}

For more information see this page.

There are no issues that match your filters.

Category
Status