rofrischmann/inline-style-prefixer

View on GitHub

Showing 161 of 397 total issues

File createPrefixer-test.js has 534 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import createPrefixer from '../createPrefixer'
import generateData from '../generator'
import plugins from '../plugins'

const browserList = {
Severity: Major
Found in modules/__tests__/createPrefixer-test.js - About 1 day to fix

    Function generatePrefixMap has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function generatePrefixMap(browserList) {
      const prefixMap = {}
    
      for (const browser in prefixBrowserMap) {
        const prefix = prefixBrowserMap[browser]
    Severity: Minor
    Found in modules/generator/generatePrefixMap.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

    Function flexboxOld has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

    function flexboxOld(property, value, style, _ref) {
      var browserName = _ref.browserName,
          browserVersion = _ref.browserVersion,
          cssPrefix = _ref.cssPrefix,
          keepUnprefixed = _ref.keepUnprefixed,
    Severity: Minor
    Found in benchmark/packages/301/dynamic/plugins/flexboxOld.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

    Function flexboxOld has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

    function flexboxOld(property, value, style, _ref) {
      var browserName = _ref.browserName,
          browserVersion = _ref.browserVersion,
          cssPrefix = _ref.cssPrefix,
          keepUnprefixed = _ref.keepUnprefixed,
    Severity: Minor
    Found in benchmark/packages/300/dynamic/plugins/flexboxOld.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

    Function flexboxOld has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

    function flexboxOld(property, value, style, _ref) {
      var browserName = _ref.browserName,
          browserVersion = _ref.browserVersion,
          cssPrefix = _ref.cssPrefix,
          keepUnprefixed = _ref.keepUnprefixed,
    Severity: Minor
    Found in benchmark/packages/302/dynamic/plugins/flexboxOld.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

    Function flexboxOld has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

    function flexboxOld(_ref) {
      var property = _ref.property;
      var value = _ref.value;
      var styles = _ref.styles;
      var _ref$browserInfo = _ref.browserInfo;
    Severity: Minor
    Found in benchmark/packages/205/plugins/flexboxOld.js - About 3 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 createPrefixer has 92 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function createPrefixer(_ref) {
      var prefixMap = _ref.prefixMap,
          plugins = _ref.plugins;
      var fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (style) {
        return style;
    Severity: Major
    Found in benchmark/packages/301/dynamic/createPrefixer.js - About 3 hrs to fix

      Function createPrefixer has 92 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function createPrefixer(_ref) {
        var prefixMap = _ref.prefixMap,
            plugins = _ref.plugins;
        var fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (style) {
          return style;
      Severity: Major
      Found in benchmark/packages/302/dynamic/createPrefixer.js - About 3 hrs to fix

        Function createPrefixer has 92 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function createPrefixer(_ref) {
          var prefixMap = _ref.prefixMap,
              plugins = _ref.plugins;
          var fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (style) {
            return style;
        Severity: Major
        Found in benchmark/packages/300/dynamic/createPrefixer.js - About 3 hrs to fix

          Consider simplifying this complex logical expression.
          Open

            if (typeof value === 'string' && value.match(values) !== null && (browserName === 'firefox' && browserVersion < 16 || browserName === 'chrome' && browserVersion < 26 || (browserName === 'safari' || browserName === 'ios_saf') && browserVersion < 7 || (browserName === 'opera' || browserName === 'op_mini') && browserVersion < 12.1 || browserName === 'android' && browserVersion < 4.4 || browserName === 'and_uc')) {
              return (0, _getPrefixedValue2.default)(cssPrefix + value, value, keepUnprefixed);
            }
          Severity: Critical
          Found in benchmark/packages/300/dynamic/plugins/gradient.js - About 3 hrs to fix

            Consider simplifying this complex logical expression.
            Open

              if (typeof value === 'string' && values.test(value) && (browserName === 'firefox' && browserVersion < 16 || browserName === 'chrome' && browserVersion < 26 || (browserName === 'safari' || browserName === 'ios_saf') && browserVersion < 7 || (browserName === 'opera' || browserName === 'op_mini') && browserVersion < 12.1 || browserName === 'android' && browserVersion < 4.4 || browserName === 'and_uc')) {
                return (0, _getPrefixedValue2.default)(cssPrefix + value, value, keepUnprefixed);
              }
            Severity: Critical
            Found in benchmark/packages/302/dynamic/plugins/gradient.js - About 3 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                if (typeof value === 'string' && value.match(values) !== null && (browser === 'firefox' && version < 16 || browser === 'chrome' && version < 26 || (browser === 'safari' || browser === 'ios_saf') && version < 7 || (browser === 'opera' || browser === 'op_mini') && version < 12.1 || browser === 'android' && version < 4.4 || browser === 'and_uc')) {
                  return _defineProperty({}, property, (0, _getPrefixedValue2.default)(css + value, value, keepUnprefixed));
                }
              Severity: Critical
              Found in benchmark/packages/205/plugins/gradient.js - About 3 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                  if (typeof value === 'string' && values.test(value) && (browserName === 'firefox' && browserVersion < 16 || browserName === 'chrome' && browserVersion < 26 || (browserName === 'safari' || browserName === 'ios_saf') && browserVersion < 7 || (browserName === 'opera' || browserName === 'op_mini') && browserVersion < 12.1 || browserName === 'android' && browserVersion < 4.4 || browserName === 'and_uc')) {
                    return (0, _getPrefixedValue2.default)(cssPrefix + value, value, keepUnprefixed);
                  }
                Severity: Critical
                Found in benchmark/packages/301/dynamic/plugins/gradient.js - About 3 hrs to fix

                  Consider simplifying this complex logical expression.
                  Open

                    if ((properties.indexOf(property) > -1 || property === 'display' && typeof value === 'string' && value.indexOf('flex') > -1) && (browser === 'firefox' && version < 22 || browser === 'chrome' && version < 21 || (browser === 'safari' || browser === 'ios_saf') && version <= 6.1 || browser === 'android' && version < 4.4 || browser === 'and_uc')) {
                      if (!keepUnprefixed && !Array.isArray(styles[property])) {
                        delete styles[property];
                      }
                      if (property === 'flexDirection' && typeof value === 'string') {
                  Severity: Critical
                  Found in benchmark/packages/205/plugins/flexboxOld.js - About 3 hrs to fix

                    Consider simplifying this complex logical expression.
                    Open

                      if ((properties.indexOf(property) > -1 || property === 'display' && typeof value === 'string' && value.indexOf('flex') > -1) && (browserName === 'firefox' && browserVersion < 22 || browserName === 'chrome' && browserVersion < 21 || (browserName === 'safari' || browserName === 'ios_saf') && browserVersion <= 6.1 || browserName === 'android' && browserVersion < 4.4 || browserName === 'and_uc')) {
                        delete requiresPrefix[property];
                    
                        if (!keepUnprefixed && !Array.isArray(style[property])) {
                          delete style[property];
                    Severity: Critical
                    Found in benchmark/packages/302/dynamic/plugins/flexboxOld.js - About 3 hrs to fix

                      Consider simplifying this complex logical expression.
                      Open

                        if ((properties.indexOf(property) > -1 || property === 'display' && typeof value === 'string' && value.indexOf('flex') > -1) && (browserName === 'firefox' && browserVersion < 22 || browserName === 'chrome' && browserVersion < 21 || (browserName === 'safari' || browserName === 'ios_saf') && browserVersion <= 6.1 || browserName === 'android' && browserVersion < 4.4 || browserName === 'and_uc')) {
                          delete requiresPrefix[property];
                      
                          if (!keepUnprefixed && !Array.isArray(style[property])) {
                            delete style[property];
                      Severity: Critical
                      Found in benchmark/packages/301/dynamic/plugins/flexboxOld.js - About 3 hrs to fix

                        Consider simplifying this complex logical expression.
                        Open

                          if ((properties.indexOf(property) > -1 || property === 'display' && typeof value === 'string' && value.indexOf('flex') > -1) && (browserName === 'firefox' && browserVersion < 22 || browserName === 'chrome' && browserVersion < 21 || (browserName === 'safari' || browserName === 'ios_saf') && browserVersion <= 6.1 || browserName === 'android' && browserVersion < 4.4 || browserName === 'and_uc')) {
                            delete requiresPrefix[property];
                        
                            if (!keepUnprefixed && !Array.isArray(style[property])) {
                              delete style[property];
                        Severity: Critical
                        Found in benchmark/packages/300/dynamic/plugins/flexboxOld.js - About 3 hrs to fix

                          Function Prefixer has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          var Prefixer = function () {
                            /**
                             * Instantiante a new prefixer
                             * @param {string} userAgent - userAgent to gather prefix information according to caniuse.com
                             * @param {string} keepUnprefixed - keeps unprefixed properties and values
                          Severity: Major
                          Found in benchmark/packages/205/Prefixer.js - About 3 hrs to fix

                            Function generatePrefixMap has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function generatePrefixMap(browserList) {
                              var prefixMap = {};
                            
                              for (var browser in prefixBrowserMap) {
                                var prefix = prefixBrowserMap[browser];
                            Severity: Minor
                            Found in benchmark/packages/700/generator/generatePrefixMap.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 createPrefixer has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                            Open

                            export default function createPrefixer({ prefixMap, plugins }) {
                              return function prefix(style) {
                                for (const property in style) {
                                  const value = style[property]
                            
                            
                            Severity: Minor
                            Found in modules/createPrefixer.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

                            Severity
                            Category
                            Status
                            Source
                            Language