etnbrd/flx-compiler

View on GitHub
prototypes/shreder/lib/builders.js

Summary

Maintainability
F
4 days
Test Coverage

Function startPlaceholder has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function startPlaceholder(next, signature) {
  return b.functionExpression(b.identifier("placeholder"), [
    ],
    b.blockStatement([
      b.returnStatement(
Severity: Minor
Found in prototypes/shreder/lib/builders.js - About 1 hr to fix

    Function register has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function register(name, fn) {
    
      // flx.register(name, function capsule(msg) {
      //   // merge scope (this) and signature (msg._sign)
      //   (function reply(req, res) {
    Severity: Minor
    Found in prototypes/shreder/lib/builders.js - About 1 hr to fix

      Function postPlaceholder has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function postPlaceholder(next, signature) {
      
        return b.callExpression(
                b.memberExpression(
                  b.identifier("flx"),
      Severity: Minor
      Found in prototypes/shreder/lib/builders.js - About 1 hr to fix

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

                b.callExpression(
                  b.memberExpression(
                    b.identifier("flx"),
                    b.identifier("start"),
                    false
        Severity: Major
        Found in prototypes/shreder/lib/builders.js and 1 other location - About 1 day to fix
        prototypes/shreder/lib/builders.js on lines 179..205

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

        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 b.callExpression(
                  b.memberExpression(
                    b.identifier("flx"),
                    b.identifier("post"),
                    false
        Severity: Major
        Found in prototypes/shreder/lib/builders.js and 1 other location - About 1 day to fix
        prototypes/shreder/lib/builders.js on lines 144..170

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

        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/shreder/lib/builders.js and 2 other locations - About 4 hrs to fix
        prototypes/blender.old/lib/builders.js on lines 19..30
        prototypes/blender/lib/templates.js on lines 19..30

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 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 flxSimple(msg) {
          return b.functionExpression(b.identifier("fn"), [
              b.identifier("msg")
            ],
            b.blockStatement([
        Severity: Major
        Found in prototypes/shreder/lib/builders.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/blender/lib/templates.js on lines 124..144
        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 HelloWorld(msg) {
          return b.functionExpression(b.identifier("HelloWorld"), [
              b.identifier("msg")
            ],
            b.blockStatement([
        Severity: Major
        Found in prototypes/shreder/lib/builders.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/blender/lib/templates.js on lines 124..144
        prototypes/shreder/lib/builders.js on lines 227..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 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 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/shreder/lib/builders.js and 2 other locations - About 2 hrs to fix
        prototypes/blender.old/lib/builders.js on lines 44..55
        prototypes/blender/lib/templates.js on lines 44..55

        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

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

        function requireflx() {
          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/shreder/lib/builders.js and 1 other location - About 1 hr to fix
        lib/js-printer/builders.js on lines 7..14

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

        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/shreder/lib/builders.js and 2 other locations - About 1 hr to fix
        prototypes/blender.old/lib/builders.js on lines 32..42
        prototypes/blender/lib/templates.js on lines 32..42

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 67.

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

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

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

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

        Refactorings

        Further Reading

        There are no issues that match your filters.

        Category
        Status