jackmellis/vuenit

View on GitHub

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;
Severity: Minor
Found in lib/component/augment.js - About 5 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 exports has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function (directives, options) {
  options = options || {};
  var defaultOptions = {
    props : {},
    element : 'div',
Severity: Major
Found in lib/directive.js - About 2 hrs to fix

    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,
    Severity: Major
    Found in lib/component/options.js - About 2 hrs to fix

      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;
      Severity: Major
      Found in lib/component/augment.js - About 2 hrs to fix

        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);
        Severity: Minor
        Found in lib/component/augment.js - About 1 hr 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 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);
        Severity: Minor
        Found in lib/component/augment.js - About 1 hr to fix

          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,
          Severity: Minor
          Found in lib/component/options.js - About 1 hr 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 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 = {};
          Severity: Minor
          Found in lib/directive.js - About 1 hr to fix

            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'){
            Severity: Minor
            Found in lib/component/options.js - About 1 hr to fix

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

              function exposeArray(arr) {
                var l = arr.length;
                if (!l){
                  return arr;
                }
              Severity: Minor
              Found in lib/component/expose-array.js - About 1 hr to fix

                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);
                Severity: Minor
                Found in lib/component/component.js - About 1 hr to fix

                  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 = {};
                  Severity: Minor
                  Found in lib/component/component.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

                  Avoid deeply nested control flow statements.
                  Open

                            switch(component.$options.name){
                            case q:
                            case deCamelCased:
                            case reCamelCased:
                            case reUpperCased:
                  Severity: Major
                  Found in lib/component/augment.js - About 45 mins to fix

                    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) || '';
                        });
                    Severity: Major
                    Found in lib/component/augment.js - About 40 mins to fix

                      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);
                      Severity: Minor
                      Found in lib/component/component.js - About 35 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

                      Severity
                      Category
                      Status
                      Source
                      Language