Showing 30 of 270 total issues
Function main
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
async function main(options) {
const job = process.env.TRAVIS_JOB_NUMBER;
if (!job) {
console.log(` ${chalk.yellow('⚠')} Skipping, "$TRAVIS_JOB_NUMBER" is not defined.`);
- 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 main
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function main() {
const state = document.querySelector('[data-stage-state]');
const stage = document.querySelector('[data-stage-demos]');
const handle = document.querySelector('[data-stage-handle]');
const img = document.createElement('img');
Function main
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function main() {
const start = Date.now();
const version = await getVersion();
const head = `release/${version}`;
Function exports
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (gulp, paths) {
'use strict';
function toHtml() {
const rewrite = function () {
return function (ast, file) {
Function exports
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (gulp, paths) {
const props = {
paths: paths,
gulp: gulp,
pkg: merge({}, pkg, pkg.config.documentation),
Function main
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
async function main() {
const start = Date.now();
const version = await getVersion();
const head = `release/${version}`;
- 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 toHtml
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function toHtml() {
const rewrite = function () {
return function (ast, file) {
const base = path.relative(file.filePath(), path.resolve('./'));
pkg.staticBase = base === '..' ? '.' : path.dirname(base);
Function main
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function main(options) {
const job = process.env.TRAVIS_JOB_NUMBER;
if (!job) {
console.log(` ${chalk.yellow('⚠')} Skipping, "$TRAVIS_JOB_NUMBER" is not defined.`);
Function main
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function main() {
const start = Date.now();
const hash = shell.exec(`git rev-parse --short HEAD`, {silent: true}).output.split('\n')[0];
const head = `gh-pages-update-${hash}`;
Function main
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
async function main() {
const start = Date.now();
const hash = shell.exec(`git rev-parse --short HEAD`, {silent: true}).output.split('\n')[0];
const head = `gh-pages-update-${hash}`;
- 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 exports
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (gulp, paths, options, cli) {
var task = require('./helpers/task')(gulp);
var build = require('./build')(gulp, paths, {fails: true, notifies: true}, cli);
return function watch(cb) {
Function watch
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function watch(cb) {
/* @desc execute sequence after changes */
var watchOptions = {fails: false, notifies: true, watch: true};
var transpile = require('./transpile')(gulp, paths, watchOptions, cli);
var documentation = require('./documentation')(gulp, paths, watchOptions, cli);
Function documentation
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function documentation(done) {
/* @desc build markdown from sources */
getApiDocumentation(paths.source.entry, ['md', 'json', 'html'], (err, docs) => {
if (err) {
return done(err);
Function exports
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (gulp, paths, options) {
options = Object.assign({}, options, {fails: true});
var args = [].slice.call(arguments);
Function initPlayer
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function initPlayer(element, keyframes, options, render, window = global.window, document = global.document) {
// Gracefully handle cases where element.animate is not defined
if (typeof element.animate !== 'function') {
const {HTMLElement = {}} = window;
const {prototype: ElementPrototype = {}} = HTMLElement;
Function onload
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onload = async function () {
const frameDocument = frame.contentDocument || frame.contentWindow.document;
const inject = getInject(frameDocument.body);
// fetch test styling
Function exports
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (props) {
return function () {
return (
`
---
Function exports
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (props) {
return `<!doctype html>
<html lang="en" prefix="og: http://ogp.me/ns#">
<head>
<title>${props.pkg.name} - ${props.pkg.description}</title>
Function exports
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (gulp) {
return function list() {
/* @desc list all public tasks */
var tasks = Object.keys(gulp.tasks || {})
.reduce(function (results, taskName) {
Function initPlayer
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default function initPlayer(element, keyframes, options, render, window = global.window, document = global.document) {
// Gracefully handle cases where element.animate is not defined
if (typeof element.animate !== 'function') {
const {HTMLElement = {}} = window;
const {prototype: ElementPrototype = {}} = HTMLElement;
- 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"