blinkjs/blink

View on GitHub

Showing 18 of 38 total issues

Function Configuration has 225 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var Configuration = (function () {
    function Configuration(options) {
        this.raw = {};
        this.set(require('../../defaults.browser.json'));
        this.set(options);
Severity: Major
Found in js/lib/browser/Configuration.js - About 1 day to fix

    Function Rule has 178 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var Rule = (function () {
        function Rule(selectors, body) {
            this.body = body;
            this._selectors = [];
            if (Array.isArray(selectors)) {
    Severity: Major
    Found in js/lib/Rule.js - About 7 hrs to fix

      Function Rule has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
      Open

      var Rule = (function () {
          function Rule(selectors, body) {
              this.body = body;
              this._selectors = [];
              if (Array.isArray(selectors)) {
      Severity: Minor
      Found in js/lib/Rule.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 Configuration has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

      var Configuration = (function () {
          function Configuration(options) {
              this.raw = {};
              this.set(require('../../defaults.browser.json'));
              this.set(options);
      Severity: Minor
      Found in js/lib/browser/Configuration.js - About 4 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

      Configuration has 32 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Configuration implements ConfigurationOptions {
      
          constructor(options?: ConfigurationOptions) {
              this.set(require('../../defaults.browser.json'));
              this.set(options);
      Severity: Minor
      Found in lib/browser/Configuration.ts - About 4 hrs to fix

        Function Formatter has 66 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var Formatter = (function () {
            function Formatter() {
            }
            Formatter.prototype.format = function (config, rules) {
                if (typeof rules === 'undefined') {
        Severity: Major
        Found in js/lib/Formatter.js - About 2 hrs to fix

          Function Configuration has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var Configuration = (function (_super) {
              __extends(Configuration, _super);
              function Configuration(options) {
                  _super.call(this, options);
                  this.set(require('../../defaults.json'));
          Severity: Minor
          Found in js/lib/Configuration.js - About 1 hr to fix

            Function Block has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var Block = (function () {
                function Block(name, body) {
                    this.name = name;
                    this.body = body;
                }
            Severity: Minor
            Found in js/lib/BEM.js - About 1 hr to fix

              Function Formatter has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

              var Formatter = (function () {
                  function Formatter() {
                  }
                  Formatter.prototype.format = function (config, rules) {
                      if (typeof rules === 'undefined') {
              Severity: Minor
              Found in js/lib/Formatter.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 Compiler has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              var Compiler = (function () {
                  function Compiler(config) {
                      this.config = config;
                  }
                  Compiler.prototype.compile = function (rules) {
              Severity: Minor
              Found in js/lib/Compiler.js - About 1 hr to fix

                Function resolveTree has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    Rule.prototype.resolveTree = function (selectors, body, seed, key) {
                        var _this = this;
                        seed = seed || {};
                        key = key || '';
                        Object.keys(body).forEach(function (k2) {
                Severity: Minor
                Found in js/lib/Rule.js - About 1 hr to fix

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

                      private resolveTree(selectors: string, body: any, seed?: any, key?: string) {
                          seed = seed || {};
                          key = key || '';
                          Object.keys(body).forEach(k2 => {
                              if (k2 === 'respond') {
                  Severity: Minor
                  Found in lib/Rule.ts - About 1 hr to fix

                    Function Modifier has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    var Modifier = (function () {
                        function Modifier(name, body) {
                            this.name = name;
                            this.body = body;
                        }
                    Severity: Minor
                    Found in js/lib/BEM.js - About 1 hr to fix

                      Function Element has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      var Element = (function () {
                          function Element(name, body) {
                              this.name = name;
                              this.body = body;
                          }
                      Severity: Minor
                      Found in js/lib/BEM.js - About 1 hr to fix

                        Function Configuration has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        var Configuration = (function (_super) {
                            __extends(Configuration, _super);
                            function Configuration(options) {
                                _super.call(this, options);
                                this.set(require('../../defaults.json'));
                        Severity: Minor
                        Found in js/lib/Configuration.js - About 55 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 compilePrimitive has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private compilePrimitive(value: any) {
                                switch (typeof value) {
                                    case 'number':
                                        if (value === 0) {
                                            return '0';
                        Severity: Minor
                        Found in lib/Rule.ts - 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 too many return statements within this function.
                        Open

                                return value;
                        Severity: Major
                        Found in lib/Rule.ts - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return value;
                          Severity: Major
                          Found in js/lib/Rule.js - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language