aurelia/aurelia

View on GitHub
packages/validation/src/ast-serialization.ts

Summary

Maintainability
F
1 wk
Test Coverage
A
94%

Function hydrate has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
Open

  public hydrate(raw: any): any {
    switch (raw.$TYPE) {
      case ASTExpressionTypes.AccessMemberExpression: {
        const expr: Pick<AST.AccessMemberExpression, 'object' | 'name'> = raw;
        return new AST.AccessMemberExpression(this.hydrate(expr.object), expr.name);
Severity: Minor
Found in packages/validation/src/ast-serialization.ts - About 1 day 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 hydrate has 125 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  public hydrate(raw: any): any {
    switch (raw.$TYPE) {
      case ASTExpressionTypes.AccessMemberExpression: {
        const expr: Pick<AST.AccessMemberExpression, 'object' | 'name'> = raw;
        return new AST.AccessMemberExpression(this.hydrate(expr.object), expr.name);
Severity: Major
Found in packages/validation/src/ast-serialization.ts - About 5 hrs to fix

    File ast-serialization.ts has 334 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* eslint-disable @typescript-eslint/no-explicit-any */
    /* eslint-disable @typescript-eslint/no-unsafe-member-access */
    import * as AST from '@aurelia/expression-parser';
    import { ErrorNames, createMappedError } from './errors';
    
    
    Severity: Minor
    Found in packages/validation/src/ast-serialization.ts - About 4 hrs to fix

      Serializer has 31 functions (exceeds 20 allowed). Consider refactoring.
      Open

      export class Serializer implements AST.IVisitor<string> {
        public static serialize(expr: AST.IsExpressionOrStatement | AST.CustomExpression): string {
          const visitor = new Serializer();
          if (expr == null) {
            return `${expr}`;
      Severity: Minor
      Found in packages/validation/src/ast-serialization.ts - About 3 hrs to fix

        Avoid too many return statements within this function.
        Open

                return new AST.TemplateExpression(this.hydrate(expr.cooked), this.hydrate(expr.expressions));
        Severity: Major
        Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return new AST.BinaryExpression(expr.operation, this.hydrate(expr.left), this.hydrate(expr.right));
          Severity: Major
          Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return new AST.DestructuringAssignmentExpression(this.hydrate(raw.$kind), this.hydrate(raw.list), this.hydrate(raw.source), this.hydrate(raw.initializer));
            Severity: Major
            Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return this.deserializeExpressions(raw);
              Severity: Major
              Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return new AST.ObjectLiteralExpression(this.hydrate(expr.keys), this.hydrate(expr.values));
                Severity: Major
                Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return new AST.DestructuringAssignmentSingleExpression(this.hydrate(raw.target), this.hydrate(raw.source), this.hydrate(raw.initializer));
                  Severity: Major
                  Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return new AST.ArrayLiteralExpression(this.hydrate(expr.elements));
                    Severity: Major
                    Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return new AST.DestructuringAssignmentRestExpression(this.hydrate(raw.target), this.hydrate(raw.indexOrProperties));
                      Severity: Major
                      Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return new AST.BindingIdentifier(expr.name);
                        Severity: Major
                        Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return new AST.UnaryExpression(expr.operation, this.hydrate(expr.expression));
                          Severity: Major
                          Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                    return new AST.ArrayBindingPattern(this.hydrate(expr.elements));
                            Severity: Major
                            Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                      return new AST.ConditionalExpression(this.hydrate(expr.condition), this.hydrate(expr.yes), this.hydrate(expr.no));
                              Severity: Major
                              Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                        return new AST.BindingBehaviorExpression(this.hydrate(expr.expression), expr.name, this.hydrate(expr.args));
                                Severity: Major
                                Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                          return new AST.ForOfStatement(this.hydrate(expr.declaration), this.hydrate(expr.iterable), this.hydrate(expr.semiIdx));
                                  Severity: Major
                                  Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                            return new AST.AccessScopeExpression(expr.name, expr.ancestor);
                                    Severity: Major
                                    Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                              return new AST.ArrowFunction(this.hydrate(raw.parameters), this.hydrate(raw.body), this.hydrate(raw.rest));
                                      Severity: Major
                                      Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                                    return raw.map(deserializePrimitive);
                                        Severity: Major
                                        Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                  return new AST.CallFunctionExpression(this.hydrate(expr.func), this.hydrate(expr.args));
                                          Severity: Major
                                          Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                    return new AST.PrimitiveLiteralExpression(this.hydrate(expr.value));
                                            Severity: Major
                                            Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                        return deserializePrimitive(raw);
                                              Severity: Major
                                              Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                        return new AST.CallMemberExpression(this.hydrate(expr.object), expr.name, this.hydrate(expr.args));
                                                Severity: Major
                                                Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                          return new AST.ValueConverterExpression(this.hydrate(expr.expression), expr.name, this.hydrate(expr.args));
                                                  Severity: Major
                                                  Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

                                                    Avoid too many return statements within this function.
                                                    Open

                                                            return new AST.ObjectBindingPattern(this.hydrate(expr.keys), this.hydrate(expr.values));
                                                    Severity: Major
                                                    Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

                                                      Avoid too many return statements within this function.
                                                      Open

                                                              return new AST.TaggedTemplateExpression(this.hydrate(expr.cooked), this.hydrate(expr.raw), this.hydrate(expr.func), this.hydrate(expr.expressions));
                                                      Severity: Major
                                                      Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

                                                        Avoid too many return statements within this function.
                                                        Open

                                                                return new AST.Interpolation(this.hydrate(expr.cooked), this.hydrate(expr.expressions));
                                                        Severity: Major
                                                        Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

                                                          Avoid too many return statements within this function.
                                                          Open

                                                                  return new AST.CallScopeExpression(expr.name, this.hydrate(expr.args), expr.ancestor);
                                                          Severity: Major
                                                          Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

                                                            Avoid too many return statements within this function.
                                                            Open

                                                                    return new AST.AssignExpression(this.hydrate(expr.target), this.hydrate(expr.value));
                                                            Severity: Major
                                                            Found in packages/validation/src/ast-serialization.ts - About 30 mins to fix

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

                                                              export function deserializePrimitive(value: unknown): any {
                                                                if (typeof value === 'string') {
                                                                  if (value === 'null') { return null; }
                                                                  if (value === 'undefined') { return undefined; }
                                                                  return value.substring(1, value.length - 1);
                                                              Severity: Minor
                                                              Found in packages/validation/src/ast-serialization.ts - 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

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

                                                                    case ASTExpressionTypes.ConditionalExpression: {
                                                                      const expr: Pick<AST.ConditionalExpression, 'condition' | 'yes' | 'no'> = raw;
                                                                      return new AST.ConditionalExpression(this.hydrate(expr.condition), this.hydrate(expr.yes), this.hydrate(expr.no));
                                                                    }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 1 other location - About 2 hrs to fix
                                                              packages/validation/src/ast-serialization.ts on lines 141..144

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

                                                              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

                                                                    case ASTExpressionTypes.ForOfStatement: {
                                                                      const expr: Pick<AST.ForOfStatement, 'declaration' | 'iterable' | 'semiIdx'> = raw;
                                                                      return new AST.ForOfStatement(this.hydrate(expr.declaration), this.hydrate(expr.iterable), this.hydrate(expr.semiIdx));
                                                                    }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 1 other location - About 2 hrs to fix
                                                              packages/validation/src/ast-serialization.ts on lines 113..116

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

                                                              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

                                                                    case ASTExpressionTypes.CallMemberExpression: {
                                                                      const expr: Pick<AST.CallMemberExpression, 'object' | 'name' | 'args'> = raw;
                                                                      return new AST.CallMemberExpression(this.hydrate(expr.object), expr.name, this.hydrate(expr.args));
                                                                    }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 2 other locations - About 2 hrs to fix
                                                              packages/validation/src/ast-serialization.ts on lines 121..124
                                                              packages/validation/src/ast-serialization.ts on lines 125..128

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

                                                              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

                                                                    case ASTExpressionTypes.BindingBehaviorExpression: {
                                                                      const expr: Pick<AST.BindingBehaviorExpression, 'expression' | 'name' | 'args'> = raw;
                                                                      return new AST.BindingBehaviorExpression(this.hydrate(expr.expression), expr.name, this.hydrate(expr.args));
                                                                    }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 2 other locations - About 2 hrs to fix
                                                              packages/validation/src/ast-serialization.ts on lines 87..90
                                                              packages/validation/src/ast-serialization.ts on lines 121..124

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

                                                              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

                                                                    case ASTExpressionTypes.ValueConverterExpression: {
                                                                      const expr: Pick<AST.ValueConverterExpression, 'expression' | 'name' | 'args'> = raw;
                                                                      return new AST.ValueConverterExpression(this.hydrate(expr.expression), expr.name, this.hydrate(expr.args));
                                                                    }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 2 other locations - About 2 hrs to fix
                                                              packages/validation/src/ast-serialization.ts on lines 87..90
                                                              packages/validation/src/ast-serialization.ts on lines 125..128

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

                                                              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

                                                                    case ASTExpressionTypes.ObjectLiteralExpression: {
                                                                      const expr: Pick<AST.ObjectLiteralExpression, 'keys' | 'values'> = raw;
                                                                      return new AST.ObjectLiteralExpression(this.hydrate(expr.keys), this.hydrate(expr.values));
                                                                    }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 5 other locations - About 2 hrs to fix
                                                              packages/validation/src/ast-serialization.ts on lines 56..59
                                                              packages/validation/src/ast-serialization.ts on lines 83..86
                                                              packages/validation/src/ast-serialization.ts on lines 95..98
                                                              packages/validation/src/ast-serialization.ts on lines 117..120
                                                              packages/validation/src/ast-serialization.ts on lines 133..136

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

                                                              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

                                                                    case ASTExpressionTypes.AccessKeyedExpression: {
                                                                      const expr: Pick<AST.AccessKeyedExpression, 'object' | 'key'> = raw;
                                                                      return new AST.AccessKeyedExpression(this.hydrate(expr.object), this.hydrate(expr.key));
                                                                    }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 5 other locations - About 2 hrs to fix
                                                              packages/validation/src/ast-serialization.ts on lines 75..78
                                                              packages/validation/src/ast-serialization.ts on lines 83..86
                                                              packages/validation/src/ast-serialization.ts on lines 95..98
                                                              packages/validation/src/ast-serialization.ts on lines 117..120
                                                              packages/validation/src/ast-serialization.ts on lines 133..136

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

                                                              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

                                                                    case ASTExpressionTypes.CallFunctionExpression: {
                                                                      const expr: Pick<AST.CallFunctionExpression, 'func' | 'args'> = raw;
                                                                      return new AST.CallFunctionExpression(this.hydrate(expr.func), this.hydrate(expr.args));
                                                                    }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 5 other locations - About 2 hrs to fix
                                                              packages/validation/src/ast-serialization.ts on lines 56..59
                                                              packages/validation/src/ast-serialization.ts on lines 75..78
                                                              packages/validation/src/ast-serialization.ts on lines 95..98
                                                              packages/validation/src/ast-serialization.ts on lines 117..120
                                                              packages/validation/src/ast-serialization.ts on lines 133..136

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

                                                              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

                                                                    case ASTExpressionTypes.AssignExpression: {
                                                                      const expr: Pick<AST.AssignExpression, 'target' | 'value'> = raw;
                                                                      return new AST.AssignExpression(this.hydrate(expr.target), this.hydrate(expr.value));
                                                                    }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 5 other locations - About 2 hrs to fix
                                                              packages/validation/src/ast-serialization.ts on lines 56..59
                                                              packages/validation/src/ast-serialization.ts on lines 75..78
                                                              packages/validation/src/ast-serialization.ts on lines 83..86
                                                              packages/validation/src/ast-serialization.ts on lines 95..98
                                                              packages/validation/src/ast-serialization.ts on lines 133..136

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

                                                              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

                                                                    case ASTExpressionTypes.ObjectBindingPattern: {
                                                                      const expr: Pick<AST.ObjectBindingPattern, 'keys' | 'values'> = raw;
                                                                      return new AST.ObjectBindingPattern(this.hydrate(expr.keys), this.hydrate(expr.values));
                                                                    }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 5 other locations - About 2 hrs to fix
                                                              packages/validation/src/ast-serialization.ts on lines 56..59
                                                              packages/validation/src/ast-serialization.ts on lines 75..78
                                                              packages/validation/src/ast-serialization.ts on lines 83..86
                                                              packages/validation/src/ast-serialization.ts on lines 95..98
                                                              packages/validation/src/ast-serialization.ts on lines 117..120

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

                                                              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

                                                                    case ASTExpressionTypes.TemplateExpression: {
                                                                      const expr: Pick<AST.TemplateExpression, 'cooked' | 'expressions'> = raw;
                                                                      return new AST.TemplateExpression(this.hydrate(expr.cooked), this.hydrate(expr.expressions));
                                                                    }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 5 other locations - About 2 hrs to fix
                                                              packages/validation/src/ast-serialization.ts on lines 56..59
                                                              packages/validation/src/ast-serialization.ts on lines 75..78
                                                              packages/validation/src/ast-serialization.ts on lines 83..86
                                                              packages/validation/src/ast-serialization.ts on lines 117..120
                                                              packages/validation/src/ast-serialization.ts on lines 133..136

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

                                                              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

                                                                public visitCallMember(expr: AST.CallMemberExpression): string {
                                                                  return `{"$TYPE":"${ASTExpressionTypes.CallMemberExpression}","name":"${expr.name}","object":${astVisit(expr.object, this)},"args":${this.serializeExpressions(expr.args)}}`;
                                                                }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 2 other locations - About 2 hrs to fix
                                                              packages/validation/src/ast-serialization.ts on lines 245..247
                                                              packages/validation/src/ast-serialization.ts on lines 248..250

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

                                                              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

                                                                public visitBindingBehavior(expr: AST.BindingBehaviorExpression): string {
                                                                  return `{"$TYPE":"${ASTExpressionTypes.BindingBehaviorExpression}","name":"${expr.name}","expression":${astVisit(expr.expression, this)},"args":${this.serializeExpressions(expr.args)}}`;
                                                                }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 2 other locations - About 2 hrs to fix
                                                              packages/validation/src/ast-serialization.ts on lines 221..223
                                                              packages/validation/src/ast-serialization.ts on lines 245..247

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

                                                              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

                                                                public visitValueConverter(expr: AST.ValueConverterExpression): string {
                                                                  return `{"$TYPE":"${ASTExpressionTypes.ValueConverterExpression}","name":"${expr.name}","expression":${astVisit(expr.expression, this)},"args":${this.serializeExpressions(expr.args)}}`;
                                                                }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 2 other locations - About 2 hrs to fix
                                                              packages/validation/src/ast-serialization.ts on lines 221..223
                                                              packages/validation/src/ast-serialization.ts on lines 248..250

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

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

                                                                public visitInterpolation(expr: AST.Interpolation): string {
                                                                  return `{"$TYPE":"${ASTExpressionTypes.Interpolation}","cooked":${serializePrimitives(expr.parts)},"expressions":${this.serializeExpressions(expr.expressions)}}`;
                                                                }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 3 other locations - About 1 hr to fix
                                                              packages/validation/src/ast-serialization.ts on lines 212..214
                                                              packages/validation/src/ast-serialization.ts on lines 227..229
                                                              packages/validation/src/ast-serialization.ts on lines 254..256

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

                                                                public visitObjectBindingPattern(expr: AST.ObjectBindingPattern): string {
                                                                  return `{"$TYPE":"${ASTExpressionTypes.ObjectBindingPattern}","keys":${serializePrimitives(expr.keys)},"values":${this.serializeExpressions(expr.values)}}`;
                                                                }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 3 other locations - About 1 hr to fix
                                                              packages/validation/src/ast-serialization.ts on lines 212..214
                                                              packages/validation/src/ast-serialization.ts on lines 227..229
                                                              packages/validation/src/ast-serialization.ts on lines 263..265

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

                                                                public visitObjectLiteral(expr: AST.ObjectLiteralExpression): string {
                                                                  return `{"$TYPE":"${ASTExpressionTypes.ObjectLiteralExpression}","keys":${serializePrimitives(expr.keys)},"values":${this.serializeExpressions(expr.values)}}`;
                                                                }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 3 other locations - About 1 hr to fix
                                                              packages/validation/src/ast-serialization.ts on lines 227..229
                                                              packages/validation/src/ast-serialization.ts on lines 254..256
                                                              packages/validation/src/ast-serialization.ts on lines 263..265

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

                                                                public visitTemplate(expr: AST.TemplateExpression): string {
                                                                  return `{"$TYPE":"${ASTExpressionTypes.TemplateExpression}","cooked":${serializePrimitives(expr.cooked)},"expressions":${this.serializeExpressions(expr.expressions)}}`;
                                                                }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 3 other locations - About 1 hr to fix
                                                              packages/validation/src/ast-serialization.ts on lines 212..214
                                                              packages/validation/src/ast-serialization.ts on lines 254..256
                                                              packages/validation/src/ast-serialization.ts on lines 263..265

                                                              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

                                                                public visitAccessKeyed(expr: AST.AccessKeyedExpression): string {
                                                                  return `{"$TYPE":"${ASTExpressionTypes.AccessKeyedExpression}","object":${astVisit(expr.object, this)},"key":${astVisit(expr.key, this)}}`;
                                                                }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 1 other location - About 1 hr to fix
                                                              packages/validation/src/ast-serialization.ts on lines 242..244

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

                                                              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

                                                                public visitAssign(expr: AST.AssignExpression): string {
                                                                  return `{"$TYPE":"${ASTExpressionTypes.AssignExpression}","target":${astVisit(expr.target, this)},"value":${astVisit(expr.value, this)}}`;
                                                                }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 1 other location - About 1 hr to fix
                                                              packages/validation/src/ast-serialization.ts on lines 196..198

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

                                                              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

                                                                      return new AST.TaggedTemplateExpression(this.hydrate(expr.cooked), this.hydrate(expr.raw), this.hydrate(expr.func), this.hydrate(expr.expressions));
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 1 other location - About 1 hr to fix
                                                              packages/validation/src/ast-serialization.ts on lines 153..153

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

                                                              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

                                                                      return new AST.DestructuringAssignmentExpression(this.hydrate(raw.$kind), this.hydrate(raw.list), this.hydrate(raw.source), this.hydrate(raw.initializer));
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 1 other location - About 1 hr to fix
                                                              packages/validation/src/ast-serialization.ts on lines 103..103

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

                                                              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

                                                                    case ASTExpressionTypes.ArrayBindingPattern: {
                                                                      const expr: Pick<AST.ArrayBindingPattern, 'elements'> = raw;
                                                                      return new AST.ArrayBindingPattern(this.hydrate(expr.elements));
                                                                    }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 2 other locations - About 1 hr to fix
                                                              packages/validation/src/ast-serialization.ts on lines 71..74
                                                              packages/validation/src/ast-serialization.ts on lines 79..82

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

                                                              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

                                                                    case ASTExpressionTypes.ArrayLiteralExpression: {
                                                                      const expr: Pick<AST.ArrayLiteralExpression, 'elements'> = raw;
                                                                      return new AST.ArrayLiteralExpression(this.hydrate(expr.elements));
                                                                    }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 2 other locations - About 1 hr to fix
                                                              packages/validation/src/ast-serialization.ts on lines 79..82
                                                              packages/validation/src/ast-serialization.ts on lines 129..132

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

                                                              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

                                                                    case ASTExpressionTypes.PrimitiveLiteralExpression: {
                                                                      const expr: Pick<AST.PrimitiveLiteralExpression, 'value'> = raw;
                                                                      return new AST.PrimitiveLiteralExpression(this.hydrate(expr.value));
                                                                    }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 2 other locations - About 1 hr to fix
                                                              packages/validation/src/ast-serialization.ts on lines 71..74
                                                              packages/validation/src/ast-serialization.ts on lines 129..132

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

                                                              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

                                                                    case ASTExpressionTypes.ArrowFunction: {
                                                                      return new AST.ArrowFunction(this.hydrate(raw.parameters), this.hydrate(raw.body), this.hydrate(raw.rest));
                                                                    }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 1 other location - About 1 hr to fix
                                                              packages/validation/src/ast-serialization.ts on lines 155..157

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

                                                              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

                                                                public visitAccessMember(expr: AST.AccessMemberExpression): string {
                                                                  return `{"$TYPE":"${ASTExpressionTypes.AccessMemberExpression}","name":"${expr.name}","object":${astVisit(expr.object, this)}}`;
                                                                }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 1 other location - About 1 hr to fix
                                                              packages/validation/src/ast-serialization.ts on lines 233..235

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

                                                              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

                                                                public visitUnary(expr: AST.UnaryExpression): string {
                                                                  return `{"$TYPE":"${ASTExpressionTypes.UnaryExpression}","operation":"${expr.operation}","expression":${astVisit(expr.expression, this)}}`;
                                                                }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 1 other location - About 1 hr to fix
                                                              packages/validation/src/ast-serialization.ts on lines 193..195

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

                                                              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

                                                                    case ASTExpressionTypes.DestructuringSingleAssignment: {
                                                                      return new AST.DestructuringAssignmentSingleExpression(this.hydrate(raw.target), this.hydrate(raw.source), this.hydrate(raw.initializer));
                                                                    }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 1 other location - About 1 hr to fix
                                                              packages/validation/src/ast-serialization.ts on lines 161..163

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

                                                              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

                                                                public visitArrayBindingPattern(expr: AST.ArrayBindingPattern): string {
                                                                  return `{"$TYPE":"${ASTExpressionTypes.ArrayBindingPattern}","elements":${this.serializeExpressions(expr.elements)}}`;
                                                                }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 1 other location - About 1 hr to fix
                                                              packages/validation/src/ast-serialization.ts on lines 209..211

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

                                                              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

                                                                public visitArrayLiteral(expr: AST.ArrayLiteralExpression): string {
                                                                  return `{"$TYPE":"${ASTExpressionTypes.ArrayLiteralExpression}","elements":${this.serializeExpressions(expr.elements)}}`;
                                                                }
                                                              Severity: Major
                                                              Found in packages/validation/src/ast-serialization.ts and 1 other location - About 1 hr to fix
                                                              packages/validation/src/ast-serialization.ts on lines 251..253

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

                                                              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

                                                                    case ASTExpressionTypes.BindingIdentifier: {
                                                                      const expr: Pick<AST.BindingIdentifier, 'name'> = raw;
                                                                      return new AST.BindingIdentifier(expr.name);
                                                                    }
                                                              Severity: Minor
                                                              Found in packages/validation/src/ast-serialization.ts and 1 other location - About 50 mins to fix
                                                              packages/validation/src/ast-serialization.ts on lines 60..63

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

                                                              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

                                                                    case ASTExpressionTypes.AccessThisExpression: {
                                                                      const expr: Pick<AST.AccessThisExpression, 'ancestor'> = raw;
                                                                      return new AST.AccessThisExpression(expr.ancestor);
                                                                    }
                                                              Severity: Minor
                                                              Found in packages/validation/src/ast-serialization.ts and 1 other location - About 50 mins to fix
                                                              packages/validation/src/ast-serialization.ts on lines 137..140

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

                                                              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

                                                                public visitCustom(expr: AST.CustomExpression): string {
                                                                  return `{"$TYPE":"${ASTExpressionTypes.Custom}","body":${expr.value}}`;
                                                                }
                                                              Severity: Minor
                                                              Found in packages/validation/src/ast-serialization.ts and 1 other location - About 35 mins to fix
                                                              packages/validation/src/ast-serialization.ts on lines 257..259

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

                                                              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

                                                                public visitBindingIdentifier(expr: AST.BindingIdentifier): string {
                                                                  return `{"$TYPE":"${ASTExpressionTypes.BindingIdentifier}","name":"${expr.name}"}`;
                                                                }
                                                              Severity: Minor
                                                              Found in packages/validation/src/ast-serialization.ts and 1 other location - About 35 mins to fix
                                                              packages/validation/src/ast-serialization.ts on lines 278..280

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

                                                              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

                                                              There are no issues that match your filters.

                                                              Category
                                                              Status