Showing 66 of 343 total issues
File story_view.jsx
has 1020 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import ReactDOM from 'react-dom';
import StoryControls from 'components/story/StoryControls';
import StoryDescription from 'components/story/StoryDescription';
import StoryHistoryLocation from 'components/story/StoryHistoryLocation';
StoryView
has 73 functions (exceeds 20 allowed). Consider refactoring. Open
const StoryView = FormView.extend({
template: storyTemplate,
alert: alertTemplate,
tagName: 'div',
File stories.js
has 412 lines of code (exceeds 250 allowed). Consider refactoring. Open
import actionTypes from 'actions/actionTypes';
import {
toggleStory,
editStory,
addNewAttributes,
File story.js
has 395 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { status, storyTypes, storyScopes } from 'libs/beta/constants';
import httpService from '../../services/httpService';
import changeCase from 'change-object-case';
import * as Label from './label';
import PropTypes from 'prop-types';
Function renderSelects
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderSelects: function () {
const $storyEstimateSelect = this.$('[data-story-estimate]');
if ($storyEstimateSelect.length) {
const storyEstimateOptions = this.model
.point_values()
File story.js
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
import actionTypes from './actionTypes';
import {
sendSuccessNotification,
sendErrorNotification,
sendDefaultErrorNotification,
Function panelHeading
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
panelHeading() {
const { project, joined } = this.props;
if (joined) {
return (
Method from_csv_row
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def from_csv_row(row)
# Ensure no email notifications get sent during CSV import
project = proxy_association.owner.project
project.suppress_notifications
- 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
Class Story
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class Story < ApplicationRecord
include ActiveModel::Transitions
extend Enumerize
before_validation :set_position_to_last
Method from_csv
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def from_csv(csv_string)
# Eager load this so that we don't have to make multiple db calls when
# searching for users by full name from the CSV.
users = proxy_association.owner.users
- 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
Class ProjectsController
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class ProjectsController < ApplicationController
before_action :set_project, only: %i[show edit update destroy import import_upload
reports ownership archive unarchive
change_archived projects_unjoined]
before_action :prepare_session, only: %i[import import_upload]
File story.js
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
import ActivityCollection from '../collections/activity_collection';
import NoteCollection from '../collections/note_collection';
import TaskCollection from '../collections/task_collection';
import SharedModelMethods from '../mixins/shared_model_methods';
Function projectBoardReducer
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
const projectBoardReducer = (state = initialState, action) => {
switch (action.type) {
case actionTypes.REQUEST_PROJECT_BOARD:
return {
...state,
Class IterationService
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class IterationService
DAYS_IN_WEEK = (1.week / 1.day)
VELOCITY_ITERATIONS = 3
STD_DEV_ITERATIONS = 10
DEFAULT_VELOCITY = 10
Function ProjectBoard
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export const ProjectBoard = ({
fetchProjectBoard,
projectId,
projectBoard,
closeHistory,
- 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
File project.js
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Cookies from 'js-cookie';
import StoryCollection from '../collections/story_collection';
import UserCollection from '../collections/user_collection';
import Iteration from '../models/iteration';
import ProjectBoard from '../models/projectBoard';
Function mergeWithFetchedStories
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mergeWithFetchedStories = (currentStories, fetchedStories) => {
if (Object.values(currentStories).length === 0) {
const firstStoriesById = fetchedStories.stories.allIds.reduce(
(acc, storyId) => {
return {
File ProjectBoard.jsx
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect, useState } from 'react';
import { connect } from 'react-redux';
import {
fetchProjectBoard,
toggleColumn,
Method change_archived
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def change_archived(archive = true)
@project = policy_scope(Project).archived.friendly.find(params[:id]) unless @project
authorize @project
result = ProjectOperations::Update.call(
- 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
File iteration.js
has 253 lines of code (exceeds 250 allowed). Consider refactoring. Open
import moment from 'moment';
import { last, isEmpty } from 'underscore';
import * as Story from './story';
const weeksBetween = (dateA, dateB) =>