Showing 66 of 343 total issues
Function sortUpdate
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
sortUpdate: function (ev, ui) {
// The target element, i.e. the StoryView.el element
var target = $(ev.target);
// Initially, try and get the id's of the previous and / or next 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 initialize
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize: function (options) {
_.extend(this, _.pick(options, 'isSearchResult'));
_.bindAll(
this,
Function sortUpdate
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
sortUpdate: function (ev, ui) {
// The target element, i.e. the StoryView.el element
var target = $(ev.target);
// Initially, try and get the id's of the previous and / or next stories
Function rebuildIterations
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
rebuildIterations: function () {
//
// Done column
//
var that = this;
Method from_csv
has 39 lines of code (exceeds 25 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
Function renderCollapsed
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderCollapsed: function (isGuest) {
this.$el.removeClass('editing');
this.$el.html(this.template({ story: this.model, view: this }));
this.$el.toggleClass(
'collapsed-iteration',
Function groupBySprints
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const groupBySprints = (
stories = [],
project,
initialSprintNumber = 1
) => {
Method import
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def import
@import_job = session[:import_job]
return if @import_job.blank?
job_result = Rails.cache.read(@import_job[:id])
- 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 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<Fragment>
<div className="search-projects">
<div className="form-group col-md-12">
Function renderReleaseStory
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderReleaseStory: function () {
this.$el.append(this.makeFormControl(this.makeTitle()));
if (this.model.get('editing')) {
this.$el.append(
Function dragStory
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const dragStory = (source, destination, backlogSprints, callback) => {
if (source && destination) {
const destinationDroppableId = JSON.parse(destination.droppableId);
const sourceDroppableId = JSON.parse(source.droppableId);
- 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 prepareColumns
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
prepareColumns: function () {
// reset columns & columns toggle
this.columns = {};
this.$columnToggles.html('');
this.$el.html(
Function getColumns
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
(column, stories, project, pastIterations) => {
switch (column) {
case Column.CHILLY_BIN:
return storiesWithScope(stories)
.filter(Column.isChillyBin)
Function transition
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
transition: function (ev) {
// The name of the function that needs to be called on the model is the
// value of the form button that was clicked.
var transitionEvent = ev.target.value;
_.each(I18n.t('story.events'), function (value, key) {
Function precompileEjs
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function precompileEjs() {
return {
name: 'precompile-ejs',
enforce: 'pre',
load: function (id) {
Function select
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
select: function (name, select_options, options) {
if (typeof options === 'undefined') {
options = {};
}
Method merge_story!
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def merge_story!(activity)
return if subject_type != 'Story' # story only
return if subject_id != activity.subject_id # only merge the exact same story change
return if updated_at > activity.updated_at # only merge from future changes
return if activity.subject_changes.blank?
- 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 addSprintWithOverflow
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const addSprintWithOverflow = (
project,
sprints,
story,
velocity,
Function StoryControls
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const StoryControls = props => {
return (
<div className="form-group story-controls">
{!props.disableChanges && (
<input
Function cardLink
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
cardLink() {
const { project, joined } = this.props;
if (project.get('archived_at')) {
return (