gasolin/provecss

View on GitHub

Showing 5 of 5 total issues

Function exports has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function(opt) {
  return function(style) {
    var rules = style.rules;
    var matchRules = [];

Severity: Minor
Found in css-mediaquery-extract.js - About 2 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 provecss has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function provecss(string, options) {
  options             = options || {};
  this.browsers       = options.browsers;
  if (options.path) {
    this.import_path  = path.basename(options.path);
Severity: Minor
Found in index.js - About 1 hr to fix

    Function matchQuery has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function matchQuery(mediaQuery, values) {
      return parseQuery(mediaQuery).some(function (query) {
        var inverse = query.inverse;
    
        // Either the parsed or specified `type` is "all", or the types must be
    Severity: Minor
    Found in css-mediaquery-match.js - About 1 hr to fix

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

      function provecss(string, options) {
        options             = options || {};
        this.browsers       = options.browsers;
        if (options.path) {
          this.import_path  = path.basename(options.path);
      Severity: Minor
      Found in index.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 import has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      Import.prototype.import = function (node, index, arr) {
        var regex    = /url\(['"]?(.*?)['"]?\)/;
        var filename = node.import.match(regex);
        if (filename && filename[1] && !isUrl(filename[1])) {
          if(this.target) {
      Severity: Minor
      Found in import.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