Showing 15 of 29 total issues
Function renderPass
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
const renderPass = (context, element, staticMarkup = false) => {
context.callback = () => {
if (context.finishedLoadingModules && !context.statesRenderPass) {
context.statesRenderPass = true;
context.renderResult = renderPass(context, element, staticMarkup);
- 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 fetchState
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
const fetchState = (mapStateToProps, mapActionsToProps) => WrappedComponent => {
return class extends Component {
static contextTypes = {
reactRouterServerAsyncRenderer: () => null,
reactRouterServerServerState: () => null,
- 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 fetchState
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
const fetchState = (mapStateToProps, mapActionsToProps) => WrappedComponent => {
return class extends Component {
static contextTypes = {
reactRouterServerAsyncRenderer: () => null,
reactRouterServerServerState: () => null,
Function componentWillMount
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
componentWillMount() {
const { reactRouterServerAsyncRenderer } = this.context;
this._componentIsMounted = true;
if (isNode()) {
- 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 renderPass
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderPass = (context, element, staticMarkup = false) => {
context.callback = () => {
if (context.finishedLoadingModules && !context.statesRenderPass) {
context.statesRenderPass = true;
context.renderResult = renderPass(context, element, staticMarkup);
Function fetchModuleInformation
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const fetchModuleInformation = modules => {
return new Promise((resolve) => {
const prevWebpackJsonp = webpackJsonp;
const finalModules = {};
let fileLoading = 0;
Consider simplifying this complex logical expression. Open
if (
(typeof stats === 'undefined' || !stats) ||
(!stats.modules || Object.prototype.toString.call(stats.modules) !== '[object Array]') ||
(!stats.chunks || Object.prototype.toString.call(stats.chunks) !== '[object Array]') ||
(!stats.entrypoints || typeof stats.entrypoints !== 'object')
Function componentWillMount
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentWillMount() {
const { reactRouterServerAsyncRenderer } = this.context;
this._componentIsMounted = true;
if (isNode()) {
Function extractModule
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function extractModule(module, stats) {
if (module.info.type === 'webpack') {
const match = findModule(module, stats.chunks);
return match ? parseWebpack(match, stats.publicPath || '') : match;
} else if (module.info.type === 'systemImportTransformer') {
- 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 findModule
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function findModule(module, chunks) {
const match = chunks.find(chunk => module.info.id == chunk.id);
if (match) return match;
for (let i = 0, len = chunks.length; i < len; ++i) {
if (chunks[i].modules) {
- 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 getWebpackId
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const getWebpackId = loadFunc => {
let matches = loadFunc.match(/\/\* System\.import \*\/\(([^\)]*)\)/);
if (typeof matches === 'object' && matches !== null && typeof matches[1] !== 'undefined') {
return matches[1];
}
- 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 matches[1];
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return matches[1];
Function constructor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
constructor(props) {
super();
if (props.context.fetchStateResults) {
this.fetchStateResults = { ...props.context.fetchStateResults };
for (let prop in this.fetchStateResults) {
- 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"