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 = {
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]
- 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 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,
- 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 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,
- 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 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,
- 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 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;
- 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 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;
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;
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;
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);
}
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);
}
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));
}
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);
}
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') {
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];
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];
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];
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
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];
- 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 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]
- 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"