Codeminer42/cm42-central

View on GitHub

Showing 331 of 343 total issues

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

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

      addStory: function (story, column) {
        var view = new StoryView({ model: story, isSearchResult: true }).render();
        this.appendViewToColumn(view, column);
        view.setFocus();
      },
    Severity: Major
    Found in app/assets/javascripts/views/project_search_view.jsx and 1 other location - About 1 hr to fix
    app/assets/javascripts/views/epic_view.js on lines 16..20

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 63.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        case actionTypes.EDIT_STORY:
          return {
            ...state,
            [action.from]: normalizeStories(
              denormalizedStories.map(
    Severity: Major
    Found in app/assets/javascripts/reducers/stories.js and 1 other location - About 1 hr to fix
    app/assets/javascripts/reducers/stories.js on lines 155..165

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 63.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        case actionTypes.STORY_FAILURE:
          return {
            ...state,
            [action.from]: normalizeStories(
              denormalizedStories.map(
    Severity: Major
    Found in app/assets/javascripts/reducers/stories.js and 1 other location - About 1 hr to fix
    app/assets/javascripts/reducers/stories.js on lines 112..122

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 63.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    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

          Complex method Activity::grouped_activities (28.8)
          Open

            def self.grouped_activities(allowed_projects, since)
              fetch_polymorphic(allowed_projects.pluck(:id), since).group_by do |activity|
                activity.created_at.beginning_of_day
              end.map do |date, activities|
                [
          Severity: Minor
          Found in app/models/activity.rb by flog

          Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

          You can read more about ABC metrics or the flog tool

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

            remainingPoints: function () {
              var estimates = _.map(this.remaining(), function (e) {
                return e.get('estimate');
              });
          
          
          Severity: Major
          Found in app/assets/javascripts/views/epic_bar_view.js and 1 other location - About 1 hr to fix
          app/assets/javascripts/views/epic_bar_view.js on lines 25..31

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 61.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

            donePoints: function () {
              var estimates = _.map(this.done(), function (e) {
                return e.get('estimate');
              });
          
          
          Severity: Major
          Found in app/assets/javascripts/views/epic_bar_view.js and 1 other location - About 1 hr to fix
          app/assets/javascripts/views/epic_bar_view.js on lines 33..39

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 61.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          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

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

                Function panelBody has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  panelBody() {
                    const { project, joined } = this.props;
                
                    if (joined) {
                      return (
                Severity: Minor
                Found in app/assets/javascripts/components/projects/ProjectCard.jsx - About 1 hr to fix

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                  ExpandedStoryRelease.propTypes = {
                    story: editingStoryPropTypesShape.isRequired,
                    onEdit: PropTypes.func.isRequired,
                    onClone: PropTypes.func.isRequired,
                    disabled: PropTypes.bool.isRequired,
                  app/assets/javascripts/components/story/ExpandedStory/ExpandedStoryNotes.jsx on lines 53..58
                  app/assets/javascripts/components/story/task/Task.jsx on lines 27..32

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 60.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  ExpandedStoryOwnedBy.propTypes = {
                    users: PropTypes.array.isRequired,
                    story: editingStoryPropTypesShape.isRequired,
                    onEdit: PropTypes.func.isRequired,
                    disabled: PropTypes.bool.isRequired,
                  app/assets/javascripts/components/story/ExpandedStory/ExpandedStoryRequestedBy.jsx on lines 20..25

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 60.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  ExpandedStoryRequestedBy.propTypes = {
                    users: PropTypes.array.isRequired,
                    story: editingStoryPropTypesShape.isRequired,
                    onEdit: PropTypes.func.isRequired,
                    disabled: PropTypes.bool.isRequired,
                  app/assets/javascripts/components/story/ExpandedStory/ExpandedStoryOwnedBy.jsx on lines 20..25

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 60.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                  Task.propTypes = {
                    task: TaskPropTypes.isRequired,
                    onToggle: PropTypes.func.isRequired,
                    onDelete: PropTypes.func.isRequired,
                    disabled: PropTypes.bool.isRequired,
                  Severity: Major
                  Found in app/assets/javascripts/components/story/task/Task.jsx and 2 other locations - About 1 hr to fix
                  app/assets/javascripts/components/story/ExpandedStory/ExpandedStoryNotes.jsx on lines 53..58
                  app/assets/javascripts/components/story/ExpandedStory/ExpandedStoryRelease/index.jsx on lines 55..60

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 60.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                  ExpandedStoryNotes.propTypes = {
                    story: editingStoryPropTypesShape.isRequired,
                    onCreate: PropTypes.func.isRequired,
                    onDelete: PropTypes.func.isRequired,
                    disabled: PropTypes.bool.isRequired,
                  app/assets/javascripts/components/story/ExpandedStory/ExpandedStoryRelease/index.jsx on lines 55..60
                  app/assets/javascripts/components/story/task/Task.jsx on lines 27..32

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 60.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Severity
                  Category
                  Status
                  Source
                  Language