Showing 14 of 22 total issues
Function render
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {
suite,
showPassed,
showFailed,
- 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 render
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { test, enableCode } = this.props;
const {
uuid,
title,
- 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 render
has 129 lines of code (exceeds 75 allowed). Consider refactoring. Open
render() {
const { test, enableCode } = this.props;
const {
uuid,
title,
Function render
has 122 lines of code (exceeds 75 allowed). Consider refactoring. Open
render() {
const {
results,
closeSideNav,
reportTitle,
Function render
has 104 lines of code (exceeds 75 allowed). Consider refactoring. Open
render() {
const { className, suite, enableChart, enableCode } = this.props;
const { expanded } = this.state;
const {
root,
Function render
has 96 lines of code (exceeds 75 allowed). Consider refactoring. Open
render() {
const {
suite,
showPassed,
showFailed,
Function render
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { className, suite, enableChart, enableCode } = this.props;
const { expanded } = this.state;
const {
root,
- 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 validateFile
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function validateFile(file) {
let data;
let err = null;
// Try to read and parse the file
- 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 render
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { className, code, lang, label, showLabel } = this.props;
const isDiff = lang === 'diff';
const isInlineDiff = isDiff && isArray(code);
const shouldHighlight = this.shouldHighlight();
- 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 _getUserOption
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function _getUserOption(userOptions, optToGet, isBool) {
const envVar = `MOCHAWESOME_${optToGet.toUpperCase()}`;
if (userOptions && typeof userOptions[optToGet] !== 'undefined') {
return isBool && typeof userOptions[optToGet] === 'string'
? userOptions[optToGet] === 'true'
- 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 getFilename
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function getFilename({ reportDir, reportFilename, timestamp }, reportData) {
const DEFAULT_FILENAME = 'mochawesome';
const NAME_REPLACE = '[name]';
const STATUS_REPLACE = '[status]';
const DATETIME_REPLACE = '[datetime]';
- 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
Avoid too many return
statements within this function. Open
return (
<CodeSnippet
className={cx('code-snippet')}
code={content}
highlight={false}
Avoid too many return
statements within this function. Open
return (
<CodeSnippet
className={cx('code-snippet')}
code={code}
highlight={highlight}
Function constructor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
constructor(data = {}, config = {}) {
Object.assign(this, {
devMode: !!config.dev,
enableChart: !!config.enableCharts,
enableCode: !!config.enableCode,
- 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"