stikjs/stik-core

View on GitHub

Showing 18 of 18 total issues

Function manager has 126 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  stik.manager = function manager(){
    var behaviors   = {},
        controllers = {},
        boundaries  = { all: {}, controller: {}, behavior: {} },
        obj = {};
Severity: Major
Found in src/manager.js - About 5 hrs to fix

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

        it("with two behavior", function(){
          var behavior, template;
    
          template = document.createElement( "div" );
          template.setAttribute( "data-behaviors", "old-behavior" );
    Severity: Major
    Found in specs/behavior_spec.js and 1 other location - About 4 hrs to fix
    specs/behavior_spec.js on lines 91..111

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

    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

        it("with three behavior", function(){
          var behavior, template;
    
          template = document.createElement( "div" );
          template.setAttribute( "data-behaviors", "old-behavior wierd-behavior" );
    Severity: Major
    Found in specs/behavior_spec.js and 1 other location - About 4 hrs to fix
    specs/behavior_spec.js on lines 69..89

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

    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

        it("should retreive a behavior boundary", function(){
          var manager = window.stik.manager(),
              boundary;
    
          manager.addBoundary({
    Severity: Major
    Found in specs/manager_spec.js and 1 other location - About 4 hrs to fix
    specs/manager_spec.js on lines 270..284

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

    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

        it("should retreive a controller boundary", function(){
          var manager = window.stik.manager(),
              boundary;
    
          manager.addBoundary({
    Severity: Major
    Found in specs/manager_spec.js and 1 other location - About 4 hrs to fix
    specs/manager_spec.js on lines 286..300

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

    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

        spec.bind = function bind( modules ){
          var templates = spec.findTemplates(),
              i = templates.length;
    
          while( i-- ){
    Severity: Major
    Found in src/action.js and 1 other location - About 3 hrs to fix
    src/behavior.js on lines 9..21

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 101.

    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

        spec.bind = function bind( modules ){
          var templates = spec.findTemplates(),
              i = templates.length;
    
          while ( i-- ) {
    Severity: Major
    Found in src/behavior.js and 1 other location - About 3 hrs to fix
    src/action.js on lines 7..19

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

    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

    Function behavior has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      stik.createBehavior = function behavior( spec ){
        if ( !spec.name ) { throw "Stik: Behavior name is missing"; }
        if ( spec.name.indexOf(" ") !== -1 ) { throw "Stik: '" + spec.name + "' is not a valid Behavior name. Please replace empty spaces with dashes ('-')"; }
        if ( !spec.executionUnit ) { throw "Stik: Behavior needs a function to use as its execution unit"; }
    
    
    Severity: Minor
    Found in src/behavior.js - About 1 hr to fix

      Function injectable has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        stik.injectable = function injectable( spec ){
          spec.instantiable = spec.instantiable || false;
          spec.resolvable = spec.resolvable || false;
          spec.cache = spec.cache || false;
      
      
      Severity: Minor
      Found in src/injectable.js - About 1 hr to fix

        Function action has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          stik.action = function action( spec ){
            if ( !spec.controller ) { throw "Stik: Action needs an controller name"; }
            if ( !spec.name ) { throw "Stik: Action name can't be empty"; }
            if ( !spec.executionUnit ) { throw "Stik: Action needs a function to use as its execution unit"; }
        
        
        Severity: Minor
        Found in src/action.js - About 1 hr to fix

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

            stik.injector = function injector( spec ){
              if ( !spec.executionUnit ) { throw "Stik: Injector needs a function to use as its execution unit"; }
          
              spec.resolveDependencies = function resolveDependencies(){
                var args = extractArguments();
          Severity: Minor
          Found in src/injector.js - About 1 hr to fix

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

                function resolveDependencies( dependencies ){
                  var injector = stik.injector({
                    executionUnit: spec.module,
                    modules: dependencies
                  });
            Severity: Minor
            Found in src/injectable.js and 1 other location - About 40 mins to fix
            src/behavior.js on lines 40..47

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

            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 resolveDependencies( modules ){
                  var injector = stik.injector({
                    executionUnit: spec.executionUnit,
                    modules: modules
                  });
            Severity: Minor
            Found in src/behavior.js and 1 other location - About 40 mins to fix
            src/injectable.js on lines 38..45

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

            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

                  expect(function(){
                    manager.addBoundary({
                      as: "with space",
                      from: "controller",
                      to: {}
            Severity: Minor
            Found in specs/manager_spec.js and 1 other location - About 40 mins to fix
            specs/manager_spec.js on lines 48..54

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

            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

                  dependencies = {
                    $template: stik.injectable({ module: {} }),
                    customModule: stik.injectable({ module: {} })
                  };
            Severity: Minor
            Found in specs/injectable_spec.js and 2 other locations - About 40 mins to fix
            specs/injectable_spec.js on lines 15..18
            specs/injectable_spec.js on lines 39..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 48.

            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

                  dependencies = {
                    $template: stik.injectable({ module:{} }),
                    customModule: stik.injectable({ module: {} })
                  };
            Severity: Minor
            Found in specs/injectable_spec.js and 2 other locations - About 40 mins to fix
            specs/injectable_spec.js on lines 39..42
            specs/injectable_spec.js on lines 78..81

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 48.

            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

                  dependencies = {
                    $template: stik.injectable({ module: {} }),
                    customModule: stik.injectable({ module: {} })
                  };
            Severity: Minor
            Found in specs/injectable_spec.js and 2 other locations - About 40 mins to fix
            specs/injectable_spec.js on lines 15..18
            specs/injectable_spec.js on lines 78..81

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 48.

            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

                  expect(function(){
                    manager.addBoundary({
                      as: "CustomObj",
                      from: "different",
                      to: {}
            Severity: Minor
            Found in specs/manager_spec.js and 1 other location - About 40 mins to fix
            specs/manager_spec.js on lines 56..62

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

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

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

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

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

            Refactorings

            Further Reading

            Severity
            Category
            Status
            Source
            Language