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) {
- Read upRead up
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) {
- Read upRead up
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;
Function controller
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
controller: function(settings, toRun) {
var $scope = [];
toRun($scope);
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) {
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) {
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(" ");
- Read upRead up
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) {
- Read upRead up
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);
- Read upRead up
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) {
- Read upRead up
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"