Showing 49 of 49 total issues
Function default
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (props) {
let headerLeft = (
<div
className="d-flex flex-row align-items-center"
onClick={props.isCollapsed ? props.onExpand : props.onCollapse}
Function dynamicScrape
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
const dynamicScrape = (url) => {
return puppeteer.launch()
.then((browser) => {
// keep track of browsers to avoid memory leaks
const id = uuid();
Function Update
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Update: function (id, name, roundup_order_shift) {
return bookshelf.transaction(transacting => {
return ArticleGroup.ById(id, transacting)
.then((articleGroup) => {
const oldOrder = articleGroup.get('roundup_order');
Function formatData
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const formatData = (metadata) => {
const analyzedData = {
title: '',
source: '',
published: '',
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const articleGroup = this.props.articleGroup;
const articleSections = [];
this.props.articles.forEach(a => {
articleSections.push(
Function create
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const create = (req, res, next) => {
let scrapeErrors;
const url = req.body.url;
const articlePromise =
scrape(url)
Function roundupUpdate
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function roundupUpdate(id, subject, to, cc, preface) {
let validationError;
if (!validateString(subject, 0, 255, true)) {
validationError = `Invalid Subject. Must be 0-255 characters: ${subject}`;
} else if (!validateString(preface, 0, 4166, true)) {
Function render
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<Modal
okText="Save"
cancelText="Cancel"
Function login
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function login(email, password) {
let validateError;
if (!validateEmail(email)) {
validateError = `Invalid Email Format: ${email}`;
} else if (!validatePassword(password)) {
Function Update
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Update: function (id, name, roundup_order_shift) {
return bookshelf.transaction(transacting => {
return ArticleGroup.ById(id, transacting)
.then((articleGroup) => {
const oldOrder = articleGroup.get('roundup_order');
- 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 updateArticle
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function updateArticle(roundup, article) {
let updatedRoundup = roundup;
// Update Entities
// Update Target Article
- 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 Update
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. 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');
- 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 init
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.init = (serve) => {
const app = express();
app.use(bodyParser.urlencoded({
extended: true,
}));
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<div id="login" className="w-100 h-100 d-flex flex-row justify-content-center align-items-center">
<div className="login-dialog bg-dark text-white p-3 text-center">
<h1>WeeklyRoundup</h1>
Function updateArticle
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function updateArticle(roundup, article) {
let updatedRoundup = roundup;
// Update Entities
// Update Target Article
Function mapDispatchToProps
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mapDispatchToProps = dispatch => {
return {
// Roundup
deleteRoundup: (id) => {
dispatch(roundupDelete(id));
Function default
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (props) {
// Mobile/Non-mobile styles
let style;
if (!props.isExpanded) {
style = {
Function articleUpdate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function articleUpdate(id, title, url, published, source, summary, group_order_shift) {
let validateError;
if (!validateUrl(url, true)) {
validateError = `Invalid Url Format: ${url}`;
} else if (!validateString(title, 0, 255, true)) {
Function default
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (state = defaultState, action) {
switch (action.type) {
case SettingsActionType.SETTINGS_LOADING:
return combine(state, {
isLoading: true,
Function Create
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Create: function (user_id) {
return bookshelf.transaction((t) => {
// Find User's most recent roundup
return Roundup.ByUserId(user_id)
.then((results) => {