Showing 15 of 15 total issues
Function find
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
function find(q, options, first) {
var result = [];
if (typeof q === 'object'){
q = q.name;
- 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 exports
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (directives, options) {
options = options || {};
var defaultOptions = {
props : {},
element : 'div',
Function mergeOptions
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.mergeOptions = function (options, config) {
options = options || {};
var defaultOptions = {
Vue : null,
injector : null,
Function find
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
function find(q, options, first) {
var result = [];
if (typeof q === 'object'){
q = q.name;
Function augment
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function augment(instance) {
if (!hasOwn(instance, '$name')){
defineGetter(instance, '$name', function () {
return (this.$options && this.$options.name) || (isElement(this) && this.tagName.toLowerCase()) || '';
}, 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"
Further reading
Function augment
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function augment(instance) {
if (!hasOwn(instance, '$name')){
defineGetter(instance, '$name', function () {
return (this.$options && this.$options.name) || (isElement(this) && this.tagName.toLowerCase()) || '';
}, true);
Function mergeOptions
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
exports.mergeOptions = function (options, config) {
options = options || {};
var defaultOptions = {
Vue : null,
injector : null,
- 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 directiveString
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
var directiveString = [].concat(directives).map(function(directiveObj){
if (typeof directiveObj === 'string'){
(function(){
var tmp = directiveObj;
directiveObj = {};
Function normaliseComponents
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.normaliseComponents = function(components, options) {
var defaultTemplate = options.defaultTemplate;
var result = {};
[].concat(components || []).forEach(function (componentGroup) {
if (typeof componentGroup === 'string'){
Function exposeArray
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function exposeArray(arr) {
var l = arr.length;
if (!l){
return arr;
}
Function mergeComponent
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.mergeComponent = function (component, options) {
if (isComponent(component)) {
// convert template into a render fn
if (component.template && !component.render){
exports.createRender(component);
Function mergeData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function mergeData(component, options) {
if (options.data){
var dataFn = component.data;
component.data = function () {
var data = {};
- 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
Avoid deeply nested control flow statements. Open
switch(component.$options.name){
case q:
case deCamelCased:
case reCamelCased:
case reUpperCased:
Consider simplifying this complex logical expression. Open
if (!hasOwn(instance, '$text')){
defineGetter(instance, '$text', function () {
var element = this.$el || (isElement(this) && this);
return element && (element.textContent || element.innerText) || '';
});
Function mergeComponent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
exports.mergeComponent = function (component, options) {
if (isComponent(component)) {
// convert template into a render fn
if (component.template && !component.render){
exports.createRender(component);
- 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"