kawan16/mithril-ui-router

View on GitHub

Showing 5 of 7 total issues

Function mx_factory has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
Open

var mx_factory = function( m ) {
    'use strict';

    var mx = {};

Severity: Minor
Found in src/mithril-ui-router.js - 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 mx_factory has 161 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var mx_factory = function( m ) {
    'use strict';

    var mx = {};

Severity: Major
Found in src/mithril-ui-router.js - About 6 hrs to fix

    Function exports has 70 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function (grunt) {
    
        // load all grunt tasks
        require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
    
    
    Severity: Major
    Found in gruntfile.js - About 2 hrs to fix

      Function go has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          mx.route.go = function( _state_ , _params_ ) {
      
              // Check parameters
              validators.string( _state_ );
      
      
      Severity: Minor
      Found in src/mithril-ui-router.js - About 1 hr to fix

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

            function $findState( url ) {
                if( ! url ) {
                    return {
                        state: defaultState,
                        parameters: {}
        Severity: Minor
        Found in src/mithril-ui-router.js - About 1 hr to fix
          Severity
          Category
          Status
          Source
          Language