mtxr/vscode-sqltools

View on GitHub

Showing 121 of 121 total issues

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

const fetchTablesAndViews = (type: ContextValue, tableType = 'table'): IBaseQueries['fetchTables'] => queryFactory`
SELECT name AS label,
  '${type}' AS type
FROM sqlite_master
WHERE LOWER(type) LIKE '${tableType.toLowerCase()}'
Severity: Major
Found in packages/driver.sqlite/src/ls/queries.ts and 1 other location - About 1 hr to fix
packages/generator-sqltools-driver/generators/app/templates/driver-ts/src/ls/queries.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 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

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

const fetchTablesAndViews = (type: ContextValue, tableType = 'table'): IBaseQueries['fetchTables'] => queryFactory`
SELECT name AS label,
  '${type}' AS type
FROM sqlite_master
WHERE LOWER(type) LIKE '${tableType.toLowerCase()}'
packages/driver.sqlite/src/ls/queries.ts on lines 37..44

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

const fetchFunctions: IBaseQueries['fetchFunctions'] = queryFactory`
SELECT
  '${ContextValue.FUNCTION}' as type,
  f.proname AS name,
  f.proname AS label,
Severity: Major
Found in packages/driver.pg/src/ls/queries.ts and 1 other location - About 1 hr to fix
packages/driver.pg/src/ls/queries.ts on lines 168..196

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

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

const fetchMaterializedViews: IBaseQueries['fetchTables'] = queryFactory`
SELECT
  '${ContextValue.MATERIALIZED_VIEW}' as type,
  (current_database())::information_schema.sql_identifier AS database,
  (nc.nspname)::information_schema.sql_identifier AS schema,
Severity: Major
Found in packages/driver.pg/src/ls/queries.ts and 1 other location - About 1 hr to fix
packages/driver.pg/src/ls/queries.ts on lines 60..81

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

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

Consider simplifying this complex logical expression.
Open

      if (
        isInComment == true &&
        (((commentChar == '#' || commentChar == '-') && char == '\n') ||
          (commentChar == '/' && (char == '*' && nextChar == '/')))
      ) {
Severity: Major
Found in packages/util/query/parse.ts - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

          if (
            ((char == '#' && nextChar == ' ') || (char == '-' && nextChar == '-') || (char == '/' && nextChar == '*')) &&
            isInString == false
          ) {
            isInComment = true;
    Severity: Major
    Found in packages/util/query/parse.ts - About 1 hr to fix

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

        getBlockCommentToken(input: string): Token {
          return this.getTokenOnFirstMatch({
            input,
            type: TokenTypes.BLOCK_COMMENT,
            regex: this.BLOCK_COMMENT_REGEX,
      Severity: Major
      Found in packages/formatter/src/core/Tokenizer.ts and 11 other locations - About 55 mins to fix
      packages/formatter/src/core/Tokenizer.ts on lines 175..181
      packages/formatter/src/core/Tokenizer.ts on lines 187..193
      packages/formatter/src/core/Tokenizer.ts on lines 203..209
      packages/formatter/src/core/Tokenizer.ts on lines 211..217
      packages/formatter/src/core/Tokenizer.ts on lines 219..225
      packages/formatter/src/core/Tokenizer.ts on lines 297..303
      packages/formatter/src/core/Tokenizer.ts on lines 305..311
      packages/formatter/src/core/Tokenizer.ts on lines 327..333
      packages/formatter/src/core/Tokenizer.ts on lines 335..341
      packages/formatter/src/core/Tokenizer.ts on lines 343..349
      packages/formatter/src/core/Tokenizer.ts on lines 359..365

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

        getAmbiguosOperatorToken(input: string): Token {
          return this.getTokenOnFirstMatch({
            input,
            type: TokenTypes.OPERATOR,
            regex: this.AMBIGUOS_OPERATOR_REGEX,
      Severity: Major
      Found in packages/formatter/src/core/Tokenizer.ts and 11 other locations - About 55 mins to fix
      packages/formatter/src/core/Tokenizer.ts on lines 175..181
      packages/formatter/src/core/Tokenizer.ts on lines 187..193
      packages/formatter/src/core/Tokenizer.ts on lines 195..201
      packages/formatter/src/core/Tokenizer.ts on lines 203..209
      packages/formatter/src/core/Tokenizer.ts on lines 211..217
      packages/formatter/src/core/Tokenizer.ts on lines 219..225
      packages/formatter/src/core/Tokenizer.ts on lines 305..311
      packages/formatter/src/core/Tokenizer.ts on lines 327..333
      packages/formatter/src/core/Tokenizer.ts on lines 335..341
      packages/formatter/src/core/Tokenizer.ts on lines 343..349
      packages/formatter/src/core/Tokenizer.ts on lines 359..365

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

        getPlainReservedToken(input: string): Token {
          return this.getTokenOnFirstMatch({
            input,
            type: TokenTypes.RESERVED,
            regex: this.RESERVED_PLAIN_REGEX,
      Severity: Major
      Found in packages/formatter/src/core/Tokenizer.ts and 11 other locations - About 55 mins to fix
      packages/formatter/src/core/Tokenizer.ts on lines 175..181
      packages/formatter/src/core/Tokenizer.ts on lines 187..193
      packages/formatter/src/core/Tokenizer.ts on lines 195..201
      packages/formatter/src/core/Tokenizer.ts on lines 203..209
      packages/formatter/src/core/Tokenizer.ts on lines 211..217
      packages/formatter/src/core/Tokenizer.ts on lines 219..225
      packages/formatter/src/core/Tokenizer.ts on lines 297..303
      packages/formatter/src/core/Tokenizer.ts on lines 305..311
      packages/formatter/src/core/Tokenizer.ts on lines 327..333
      packages/formatter/src/core/Tokenizer.ts on lines 335..341
      packages/formatter/src/core/Tokenizer.ts on lines 359..365

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

        getLineCommentToken(input: string): Token {
          return this.getTokenOnFirstMatch({
            input,
            type: TokenTypes.LINE_COMMENT,
            regex: this.LINE_COMMENT_REGEX,
      Severity: Major
      Found in packages/formatter/src/core/Tokenizer.ts and 11 other locations - About 55 mins to fix
      packages/formatter/src/core/Tokenizer.ts on lines 175..181
      packages/formatter/src/core/Tokenizer.ts on lines 195..201
      packages/formatter/src/core/Tokenizer.ts on lines 203..209
      packages/formatter/src/core/Tokenizer.ts on lines 211..217
      packages/formatter/src/core/Tokenizer.ts on lines 219..225
      packages/formatter/src/core/Tokenizer.ts on lines 297..303
      packages/formatter/src/core/Tokenizer.ts on lines 305..311
      packages/formatter/src/core/Tokenizer.ts on lines 327..333
      packages/formatter/src/core/Tokenizer.ts on lines 335..341
      packages/formatter/src/core/Tokenizer.ts on lines 343..349
      packages/formatter/src/core/Tokenizer.ts on lines 359..365

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

        getCloseParenToken(input: string): Token {
          return this.getTokenOnFirstMatch({
            input,
            type: TokenTypes.CLOSE_PAREN,
            regex: this.CLOSE_PAREN_REGEX,
      Severity: Major
      Found in packages/formatter/src/core/Tokenizer.ts and 11 other locations - About 55 mins to fix
      packages/formatter/src/core/Tokenizer.ts on lines 175..181
      packages/formatter/src/core/Tokenizer.ts on lines 187..193
      packages/formatter/src/core/Tokenizer.ts on lines 195..201
      packages/formatter/src/core/Tokenizer.ts on lines 203..209
      packages/formatter/src/core/Tokenizer.ts on lines 211..217
      packages/formatter/src/core/Tokenizer.ts on lines 297..303
      packages/formatter/src/core/Tokenizer.ts on lines 305..311
      packages/formatter/src/core/Tokenizer.ts on lines 327..333
      packages/formatter/src/core/Tokenizer.ts on lines 335..341
      packages/formatter/src/core/Tokenizer.ts on lines 343..349
      packages/formatter/src/core/Tokenizer.ts on lines 359..365

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

        getWordToken(input: string): Token {
          return this.getTokenOnFirstMatch({
            input,
            type: TokenTypes.WORD,
            regex: this.WORD_REGEX,
      Severity: Major
      Found in packages/formatter/src/core/Tokenizer.ts and 11 other locations - About 55 mins to fix
      packages/formatter/src/core/Tokenizer.ts on lines 175..181
      packages/formatter/src/core/Tokenizer.ts on lines 187..193
      packages/formatter/src/core/Tokenizer.ts on lines 195..201
      packages/formatter/src/core/Tokenizer.ts on lines 203..209
      packages/formatter/src/core/Tokenizer.ts on lines 211..217
      packages/formatter/src/core/Tokenizer.ts on lines 219..225
      packages/formatter/src/core/Tokenizer.ts on lines 297..303
      packages/formatter/src/core/Tokenizer.ts on lines 305..311
      packages/formatter/src/core/Tokenizer.ts on lines 327..333
      packages/formatter/src/core/Tokenizer.ts on lines 335..341
      packages/formatter/src/core/Tokenizer.ts on lines 343..349

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

        getWhitespaceToken(input: string): Token {
          return this.getTokenOnFirstMatch({
            input,
            type: TokenTypes.WHITESPACE,
            regex: this.WHITESPACE_REGEX,
      Severity: Major
      Found in packages/formatter/src/core/Tokenizer.ts and 11 other locations - About 55 mins to fix
      packages/formatter/src/core/Tokenizer.ts on lines 187..193
      packages/formatter/src/core/Tokenizer.ts on lines 195..201
      packages/formatter/src/core/Tokenizer.ts on lines 203..209
      packages/formatter/src/core/Tokenizer.ts on lines 211..217
      packages/formatter/src/core/Tokenizer.ts on lines 219..225
      packages/formatter/src/core/Tokenizer.ts on lines 297..303
      packages/formatter/src/core/Tokenizer.ts on lines 305..311
      packages/formatter/src/core/Tokenizer.ts on lines 327..333
      packages/formatter/src/core/Tokenizer.ts on lines 335..341
      packages/formatter/src/core/Tokenizer.ts on lines 343..349
      packages/formatter/src/core/Tokenizer.ts on lines 359..365

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

        getToplevelReservedToken(input: string): Token {
          return this.getTokenOnFirstMatch({
            input,
            type: TokenTypes.RESERVED_TOP_LEVEL,
            regex: this.RESERVED_TOP_LEVEL_REGEX,
      Severity: Major
      Found in packages/formatter/src/core/Tokenizer.ts and 11 other locations - About 55 mins to fix
      packages/formatter/src/core/Tokenizer.ts on lines 175..181
      packages/formatter/src/core/Tokenizer.ts on lines 187..193
      packages/formatter/src/core/Tokenizer.ts on lines 195..201
      packages/formatter/src/core/Tokenizer.ts on lines 203..209
      packages/formatter/src/core/Tokenizer.ts on lines 211..217
      packages/formatter/src/core/Tokenizer.ts on lines 219..225
      packages/formatter/src/core/Tokenizer.ts on lines 297..303
      packages/formatter/src/core/Tokenizer.ts on lines 305..311
      packages/formatter/src/core/Tokenizer.ts on lines 335..341
      packages/formatter/src/core/Tokenizer.ts on lines 343..349
      packages/formatter/src/core/Tokenizer.ts on lines 359..365

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

        getOpenParenToken(input: string): Token {
          return this.getTokenOnFirstMatch({
            input,
            type: TokenTypes.OPEN_PAREN,
            regex: this.OPEN_PAREN_REGEX,
      Severity: Major
      Found in packages/formatter/src/core/Tokenizer.ts and 11 other locations - About 55 mins to fix
      packages/formatter/src/core/Tokenizer.ts on lines 175..181
      packages/formatter/src/core/Tokenizer.ts on lines 187..193
      packages/formatter/src/core/Tokenizer.ts on lines 195..201
      packages/formatter/src/core/Tokenizer.ts on lines 203..209
      packages/formatter/src/core/Tokenizer.ts on lines 219..225
      packages/formatter/src/core/Tokenizer.ts on lines 297..303
      packages/formatter/src/core/Tokenizer.ts on lines 305..311
      packages/formatter/src/core/Tokenizer.ts on lines 327..333
      packages/formatter/src/core/Tokenizer.ts on lines 335..341
      packages/formatter/src/core/Tokenizer.ts on lines 343..349
      packages/formatter/src/core/Tokenizer.ts on lines 359..365

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

        getNoSpaceOperatorToken(input: string): Token {
          return this.getTokenOnFirstMatch({
            input,
            type: TokenTypes.NO_SPACE_OPERATOR,
            regex: this.NO_SPACE_OPERATOR_REGEX,
      Severity: Major
      Found in packages/formatter/src/core/Tokenizer.ts and 11 other locations - About 55 mins to fix
      packages/formatter/src/core/Tokenizer.ts on lines 175..181
      packages/formatter/src/core/Tokenizer.ts on lines 187..193
      packages/formatter/src/core/Tokenizer.ts on lines 195..201
      packages/formatter/src/core/Tokenizer.ts on lines 203..209
      packages/formatter/src/core/Tokenizer.ts on lines 211..217
      packages/formatter/src/core/Tokenizer.ts on lines 219..225
      packages/formatter/src/core/Tokenizer.ts on lines 297..303
      packages/formatter/src/core/Tokenizer.ts on lines 327..333
      packages/formatter/src/core/Tokenizer.ts on lines 335..341
      packages/formatter/src/core/Tokenizer.ts on lines 343..349
      packages/formatter/src/core/Tokenizer.ts on lines 359..365

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

        getStringToken(input: string): Token {
          return this.getTokenOnFirstMatch({
            input,
            type: TokenTypes.STRING,
            regex: this.STRING_REGEX,
      Severity: Major
      Found in packages/formatter/src/core/Tokenizer.ts and 11 other locations - About 55 mins to fix
      packages/formatter/src/core/Tokenizer.ts on lines 175..181
      packages/formatter/src/core/Tokenizer.ts on lines 187..193
      packages/formatter/src/core/Tokenizer.ts on lines 195..201
      packages/formatter/src/core/Tokenizer.ts on lines 211..217
      packages/formatter/src/core/Tokenizer.ts on lines 219..225
      packages/formatter/src/core/Tokenizer.ts on lines 297..303
      packages/formatter/src/core/Tokenizer.ts on lines 305..311
      packages/formatter/src/core/Tokenizer.ts on lines 327..333
      packages/formatter/src/core/Tokenizer.ts on lines 335..341
      packages/formatter/src/core/Tokenizer.ts on lines 343..349
      packages/formatter/src/core/Tokenizer.ts on lines 359..365

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

        getNewlineReservedToken(input: string): Token {
          return this.getTokenOnFirstMatch({
            input,
            type: TokenTypes.RESERVED_NEWLINE,
            regex: this.RESERVED_NEWLINE_REGEX,
      Severity: Major
      Found in packages/formatter/src/core/Tokenizer.ts and 11 other locations - About 55 mins to fix
      packages/formatter/src/core/Tokenizer.ts on lines 175..181
      packages/formatter/src/core/Tokenizer.ts on lines 187..193
      packages/formatter/src/core/Tokenizer.ts on lines 195..201
      packages/formatter/src/core/Tokenizer.ts on lines 203..209
      packages/formatter/src/core/Tokenizer.ts on lines 211..217
      packages/formatter/src/core/Tokenizer.ts on lines 219..225
      packages/formatter/src/core/Tokenizer.ts on lines 297..303
      packages/formatter/src/core/Tokenizer.ts on lines 305..311
      packages/formatter/src/core/Tokenizer.ts on lines 327..333
      packages/formatter/src/core/Tokenizer.ts on lines 343..349
      packages/formatter/src/core/Tokenizer.ts on lines 359..365

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

      if (process.env.PRODUCT === 'ext') {
        telemetry = require('./vscode').default;
      } else {
        telemetry = require('./generic').default;
      }
      Severity: Minor
      Found in packages/util/telemetry/index.ts and 1 other location - About 55 mins to fix
      packages/util/config-manager/index.ts on lines 4..8

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

      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

      if (process.env.PRODUCT === 'ext') {
        Config = require('./vscode').default;
      } else {
        Config = require('./generic').default;
      }
      Severity: Minor
      Found in packages/util/config-manager/index.ts and 1 other location - About 55 mins to fix
      packages/util/telemetry/index.ts on lines 4..8

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

      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