Showing 66 of 343 total issues
Function filterAndRemoveStories
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const filterAndRemoveStories = (mergedStories, fetchedStories) => {
const serverBasedIds = Object.values(mergedStories.stories.byId)
.filter(story => story.serverBased)
.map(story => story.id);
Function panelBody
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
panelBody() {
const { project, joined } = this.props;
if (joined) {
return (
Function storiesReducer
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const storiesReducer = (state = initialState, action) => {
const denormalizedStories = denormalizeStories(state[action.from]);
switch (action.type) {
case actionTypes.RECEIVE_STORIES: {
- 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 newStory
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
newStory: function () {
if ($(window).width() <= 992) {
_.each(this.columns, function (column, columnId) {
if (columnId !== 'chilly_bin') if (!column.hidden()) column.toggle();
});
- 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 velocity
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
velocity: function (userVelocity) {
if (!_.isUndefined(userVelocity)) {
if (userVelocity < 1) {
userVelocity = 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
Method fetch_polymorphic
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.fetch_polymorphic(ids, since)
stories = where("subject_type in ('Project', 'Story')")
.includes(:user, :subject)
.projects(ids)
.since(since).to_a
- 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 scrollToStory
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
scrollToStory: function (story_hash) {
if (story_hash.lastIndexOf('#story', 0) === 0) {
var story = $(story_hash);
if (story.length > 0) {
story.click();
- 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
Method set_started_at
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def set_started_at
return unless state_changed?
return unless state == 'started'
self.started_at = Time.current if started_at.nil?
self.owned_by = acting_user if owned_by.nil? && acting_user
- 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
Method resolve
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def resolve
if root?
User
elsif admin?
if current_project
- 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 {
...state,
[action.from]: normalizeStories(
replaceOrAddNewStory(denormalizedStories, clonedStory)
),
Avoid too many return
statements within this function. Open
return {
...state,
[action.from]: normalizeStories(
withoutNewStory(denormalizedStories, action.id)
),
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return {
...state,
[action.from]: normalizeStories(
denormalizedStories.map(updateIfSameId(action.id, toggleStory))
),
Avoid too many return
statements within this function. Open
if ($(e.target).parent().is('button')) return false;
Avoid too many return
statements within this function. Open
return dragDropStory(dragStory.id, dragStory.projectId, {
position,
newPosition,
state: newState,
});
Function renderNotes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
renderNotes: function () {
const $storyNotes = this.$('[data-story-notes]');
if ($storyNotes.length && !this.model.isNew()) {
const isReadonly = this.isReadonly();
const notes = this.model.notes;
- 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 ExpandedStoryControls
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ExpandedStoryControls = ({
onSave,
onCancel,
onDelete,
canSave,
- 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
Method column
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def column
case state
when 'unscheduled'
'#chilly_bin'
when 'unstarted'
- 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 mergeWithFetchedStories
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const mergeWithFetchedStories = (currentStories, fetchedStories) => {
if (Object.values(currentStories).length === 0) {
const firstStoriesById = fetchedStories.stories.allIds.reduce(
(acc, storyId) => {
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"
Further reading
Function renderSelects
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
renderSelects: function () {
const $storyEstimateSelect = this.$('[data-story-estimate]');
if ($storyEstimateSelect.length) {
const storyEstimateOptions = this.model
.point_values()
- 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"