Codeminer42/cm42-central

View on GitHub

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
Severity: Minor
Found in app/assets/javascripts/views/story_view.jsx - About 1 hr to fix

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,
Severity: Minor
Found in app/assets/javascripts/views/story_view.jsx - About 1 hr to fix

    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
    Severity: Minor
    Found in app/assets/javascripts/views/story_view.jsx - About 1 hr to fix

      Function rebuildIterations has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          rebuildIterations: function () {
            //
            // Done column
            //
            var that = this;
      Severity: Minor
      Found in app/assets/javascripts/models/project.js - About 1 hr to fix

        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
        
        
        Severity: Minor
        Found in app/models/project.rb - About 1 hr to fix

          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',
          Severity: Minor
          Found in app/assets/javascripts/views/story_view.jsx - About 1 hr to fix

            Function groupBySprints has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const groupBySprints = (
              stories = [],
              project,
              initialSprintNumber = 1
            ) => {
            Severity: Minor
            Found in app/assets/javascripts/models/beta/iteration.js - About 1 hr to fix

              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])
              Severity: Minor
              Found in app/controllers/projects_controller.rb - About 1 hr to fix

              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">
              Severity: Minor
              Found in app/assets/javascripts/components/projects/ProjectSearch.jsx - About 1 hr to fix

                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(
                Severity: Minor
                Found in app/assets/javascripts/views/story_view.jsx - About 1 hr to fix

                  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);
                  
                  
                  Severity: Minor
                  Found in app/assets/javascripts/models/beta/projectBoard.js - About 1 hr to fix

                  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(
                  Severity: Minor
                  Found in app/assets/javascripts/views/project_view.jsx - About 1 hr to fix

                    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)
                    Severity: Minor
                    Found in app/assets/javascripts/selectors/columns.js - About 1 hr to fix

                      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) {
                      Severity: Minor
                      Found in app/assets/javascripts/views/story_view.jsx - About 1 hr to fix

                        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) {
                        Severity: Minor
                        Found in app/assets/javascripts/libs/precompile_ejs.js - About 1 hr to fix

                          Function select has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            select: function (name, select_options, options) {
                              if (typeof options === 'undefined') {
                                options = {};
                              }
                          
                          
                          Severity: Minor
                          Found in app/assets/javascripts/views/form_view.js - About 1 hr to fix

                            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?
                            Severity: Minor
                            Found in app/models/activity.rb - About 1 hr to fix

                            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,
                            Severity: Minor
                            Found in app/assets/javascripts/models/beta/iteration.js - About 1 hr to fix

                              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
                              Severity: Minor
                              Found in app/assets/javascripts/components/story/StoryControls.jsx - About 1 hr to fix

                                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 (
                                Severity: Minor
                                Found in app/assets/javascripts/components/projects/ProjectCard.jsx - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language