etnbrd/flx-compiler

View on GitHub
prototypes/blender/lib/templates.js

Summary

Maintainability
F
3 days
Test Coverage

Function placeholder has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function placeholder(name, next) {
  return b.functionExpression(b.identifier(name), [
      b.identifier("req"),
      b.identifier("res")
    ],
Severity: Minor
Found in prototypes/blender/lib/templates.js - About 1 hr to fix

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

    function placeholder(name, next) {
      return b.functionExpression(b.identifier(name), [
          b.identifier("req"),
          b.identifier("res")
        ],
    Severity: Major
    Found in prototypes/blender/lib/templates.js and 1 other location - About 6 hrs to fix
    prototypes/blender.old/lib/builders.js on lines 70..100

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    function requires(path) {
      return b.variableDeclaration("var", [
        b.variableDeclarator(b.identifier("flx"), b.callExpression(
          b.identifier("require"), // Anonymize the function expression.
          [b.literal("./lib/flx")]
    Severity: Major
    Found in prototypes/blender/lib/templates.js and 2 other locations - About 4 hrs to fix
    prototypes/blender.old/lib/builders.js on lines 19..30
    prototypes/shreder/lib/builders.js on lines 25..36

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

    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

    function HelloWorld(msg) {
      return b.functionExpression(b.identifier("HelloWorld"), [
          b.identifier("msg")
        ],
        b.blockStatement([
    Severity: Major
    Found in prototypes/blender/lib/templates.js and 5 other locations - About 3 hrs to fix
    prototypes/blender.old/lib/builders.js on lines 102..122
    prototypes/blender.old/lib/builders.js on lines 124..144
    prototypes/blender/lib/templates.js on lines 102..122
    prototypes/shreder/lib/builders.js on lines 227..247
    prototypes/shreder/lib/builders.js on lines 249..269

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

    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

    function flxSimple(msg) {
      return b.functionExpression(b.identifier("fn"), [
          b.identifier("msg")
        ],
        b.blockStatement([
    Severity: Major
    Found in prototypes/blender/lib/templates.js and 5 other locations - About 3 hrs to fix
    prototypes/blender.old/lib/builders.js on lines 102..122
    prototypes/blender.old/lib/builders.js on lines 124..144
    prototypes/blender/lib/templates.js on lines 124..144
    prototypes/shreder/lib/builders.js on lines 227..247
    prototypes/shreder/lib/builders.js on lines 249..269

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    function route(path, next, name) {
      return b.expressionStatement(
        b.callExpression(
          b.memberExpression(b.identifier("web"), b.identifier("route"), false),
          [
    Severity: Major
    Found in prototypes/blender/lib/templates.js and 1 other location - About 2 hrs to fix
    prototypes/blender.old/lib/builders.js on lines 57..68

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    function registerScp(name, fn, scp) {
      return b.expressionStatement(
        b.callExpression(
          b.memberExpression(b.identifier("flx"), b.identifier("register"), false),
          [
    Severity: Major
    Found in prototypes/blender/lib/templates.js and 2 other locations - About 2 hrs to fix
    prototypes/blender.old/lib/builders.js on lines 44..55
    prototypes/shreder/lib/builders.js on lines 59..70

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    function register(name, fn) {
      return b.expressionStatement(
        b.callExpression(
          b.memberExpression(b.identifier("flx"), b.identifier("register"), false),
          [
    Severity: Major
    Found in prototypes/blender/lib/templates.js and 2 other locations - About 1 hr to fix
    prototypes/blender.old/lib/builders.js on lines 32..42
    prototypes/shreder/lib/builders.js on lines 47..57

    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

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

    module.exports = {
      program: program,
      requires: requires,
      register: register,
      registerScp: registerScp,
    Severity: Minor
    Found in prototypes/blender/lib/templates.js and 1 other location - About 50 mins to fix
    prototypes/blender.old/lib/builders.js on lines 3..12

    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

    There are no issues that match your filters.

    Category
    Status