Showing 49 of 49 total issues
Function render
has 166 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
let content;
let buttons;
let modal;
if (this.props.Roundup.roundup && this.props.Roundup.roundup.result) {
Function default
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function (state = defaultState, action) {
switch (action.type) {
// ROUNDUP ACTIONS
case RoundupActionType.ROUNDUP_LOADING:
File View.js
has 353 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { withRouter } from 'react-router';
import dotprop from 'dot-prop-immutable';
import { TransitionGroup } from 'react-transition-group';
Function render
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
// Users Pagination module
const pagination = (
<Pagination
activePage={this.props.Users.page}
Function init
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Open
exports.init = () =>
knex.schema.hasTable('user').then((exists) => {
if (!exists) {
return createUserTable(knex);
}
- 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 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
let content;
let buttons;
if (this.props.Roundup.isSending) {
Function render
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const buttons = (
<div>
<MenuButton name="close" text="Cancel" onClick={this.onCancel} />
<MenuButton name="check" className="px-3" text="Save" onClick={this.onSave} />
Function render
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
let pagination;
if (this.props.Archive.totalCount) {
pagination = (
<Pagination
Function render
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const article = this.props.article;
return (
<SectionEditable
Function render
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
let content;
if (this.props.Auth.isPasswordReset) {
// Step 3: Show success and direct user to Login
content = (
Function Update
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Update: function (id, title, source, published, summary, url, article_group_id, group_order_shift) {
return bookshelf.transaction(transacting => {
return Article.ById(id, transacting)
.then((article) => {
const oldOrder = article.get('group_order');
Function default
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function (state = defaultState, action) {
switch (action.type) {
case AuthActionType.LOGGING_IN:
return combine(defaultState, {
isLoading: true,
Function render
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
if (this.props.isLoading) {
return <LoadingSpinner />;
}
Function articleCreate
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function articleCreate(article_group_id, urls = [], group_order_start = 0) {
// Validate urls
let validationError;
if (urls.length === 0) {
validationError = 'Please provide at least one url to analyze.';
Function saveUser
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const saveUser = (req, res) => {
const saveUserHelper = (user) => {
if (req.body.password && req.body.password.trim().length > 0) {
user.setPassword(req.body.password);
}
Function formatData
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
const formatData = (metadata) => {
const analyzedData = {
title: '',
source: '',
published: '',
- 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 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const linksMarkup = [];
for (let i = 0; i < this.state.links.length; i++) {
const link = this.state.links[i];
linksMarkup.push(
Function formatRoundup
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.formatRoundup = function (baseUrl, roundup, signature) {
let content = '';
if (roundup && roundup.articleGroups) {
roundup.articleGroups.forEach(ag => {
// Only show article groups with articles
Function default
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function (state = defaultState, action) {
switch (action.type) {
case UsersActionType.USERS_LOADING:
return combine(defaultState, {
isLoading: true,
Function UpdateDiffRecipients
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
UpdateDiffRecipients: function (transacting, roundup, to = [], cc = []) {
const promises = [];
const toHash = {};
const ccHash = {};
const roundupToHash = {};