Showing 11 of 51 total issues
Function reference
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
reference(key: string) {
const storageKey = this.getKeyName(key)
return {
set(value: string) {
- 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 build
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
function build(previousFileSizes) {
console.log('Creating an optimized production build...');
webpack(config).run((err, stats) => {
if (err) {
printErrors('Failed to compile.', [err]);
Function setupCompiler
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setupCompiler(host, port, protocol) {
// "Compiler" is a low-level interface to Webpack.
// It lets us listen to some events and provide our own custom messages.
compiler = webpack(config, handleCompile);
Function render
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
if (!this.props.rootStore || !this.props.rootStore.projectListStore.hasProject(this.props.id)) {
// tslint:disable-next-line
this.props.rootStore && this.props.rootStore.uiStore.setError(true)
return null
Function addMiddleware
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addMiddleware(devServer) {
// `proxy` lets you to specify a fallback server during development.
// Every unrecognized request will be forwarded to it.
var proxy = require(paths.appPackageJson).proxy;
devServer.use(historyApiFallback({
Function printErrors
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function printErrors(summary, errors) {
console.log(chalk.red(summary));
console.log();
errors.forEach(err => {
let linePointer;
Function constructor
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(rootStore: RootStore) {
this.rootStore = rootStore
this.instance = Router5(
ROUTES, {
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<Root>
<HeaderSave
cancelHandler={this.cancelHandler}
Function reference
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
reference(key: string) {
const storageKey = this.getKeyName(key)
return {
set(value: string) {
Function addMiddleware
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function addMiddleware(devServer) {
// `proxy` lets you to specify a fallback server during development.
// Every unrecognized request will be forwarded to it.
var proxy = require(paths.appPackageJson).proxy;
devServer.use(historyApiFallback({
- 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 renderCurrentView
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
renderCurrentView() {
if (this.props.rootStore) {
switch (this.props.rootStore.uiStore.currentView.name) {
case (VIEW_NAMES.projectList):
return (
- 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"