unsplit/unsplit

View on GitHub
src/core.js

Summary

Maintainability
D
2 days
Test Coverage

Function keypress has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    keypress: function(expression, toRun) {
        if(expression !== undefined) {
            var spl = expression.split(":");

            if(spl.length > 1) {
Severity: Minor
Found in src/core.js - About 3 hrs 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 template has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    template: function(input, template) {
        if(typeof Handlebars === "undefined") {
            if(typeof input !== "object") {
                if(template) {

Severity: Minor
Found in src/core.js - About 3 hrs 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

File core.js has 293 lines of code (exceeds 250 allowed). Consider refactoring.
Open

function $(element) {
    if(typeof element === "string") {
        $element.selected = document.querySelector(element);
    } else {
        $element.selected = element;
Severity: Minor
Found in src/core.js - About 3 hrs to fix

    Function controller has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        controller: function(settings, toRun) {
    
            var $scope = [];
    
            toRun($scope);
    Severity: Minor
    Found in src/core.js - About 1 hr to fix

      Function template has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          template: function(input, template) {
              if(typeof Handlebars === "undefined") {
                  if(typeof input !== "object") {
                      if(template) {
      
      
      Severity: Minor
      Found in src/core.js - About 1 hr to fix

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

            keypress: function(expression, toRun) {
                if(expression !== undefined) {
                    var spl = expression.split(":");
        
                    if(spl.length > 1) {
        Severity: Minor
        Found in src/core.js - About 1 hr to fix

          Function hasClass has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              hasClass: function (theClass) {
                  for (i = 0; i < this.selected.attributes.length; i++) {
                      var attribute = this.selected.attributes[i];
                      if (attribute.name === "class") {
                          var classes = attribute.value.split(" ");
          Severity: Minor
          Found in src/core.js - About 45 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

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

              attr: function (value, newValue) {
                  for (i = 0; i < this.selected.attributes.length; i++) {
                      var attribute = this.selected.attributes[i];
          
                      if (attribute.name === value) {
          Severity: Minor
          Found in src/core.js - 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

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

              controller: function(settings, toRun) {
          
                  var $scope = [];
          
                  toRun($scope);
          Severity: Minor
          Found in src/core.js - 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

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

              watch: function(scope, model) {
          
                  if(this.selected.type == "checkbox") {
                      this.selected.onclick = function(e){
                          if(scope[model] !== true) {
          Severity: Minor
          Found in src/core.js - 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

          There are no issues that match your filters.

          Category
          Status