WikiEducationFoundation/WikiEduDashboard

View on GitHub

Showing 1,672 of 1,672 total issues

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

const fetchDefaultCamapignPromise = async () => {
  const response = await request('/settings/default_campaign');

  if (!response.ok) {
    logErrorMessage(response);
Severity: Major
Found in app/assets/javascripts/actions/settings_actions.js and 7 other locations - About 2 hrs to fix
app/assets/javascripts/actions/campaign_actions.js on lines 86..95
app/assets/javascripts/actions/settings_actions.js on lines 15..24
app/assets/javascripts/actions/settings_actions.js on lines 334..343
app/assets/javascripts/actions/settings_actions.js on lines 459..468
app/assets/javascripts/actions/tag_actions.js on lines 29..38
app/assets/javascripts/actions/training_actions.js on lines 11..20
app/assets/javascripts/actions/wizard_actions.js on lines 21..30

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 85.

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 5 locations. Consider refactoring.
Open

    case SORT_COURSE_SEARCH_RESULTS: {
      const sorted = sortByKey(
        state.results,
        action.key,
        state.sort.sortKey,
Severity: Major
Found in app/assets/javascripts/reducers/course_search_results.js and 4 other locations - About 2 hrs to fix
app/assets/javascripts/reducers/active_courses.js on lines 29..44
app/assets/javascripts/reducers/campaigns.js on lines 56..71
app/assets/javascripts/reducers/tickets.js on lines 117..128
app/assets/javascripts/reducers/wiki_courses.js on lines 27..42

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 85.

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 5 locations. Consider refactoring.
Open

    case SORT_WIKI_COURSES: {
      const sorted = sortByKey(
        state.courses,
        action.key,
        state.sort.sortKey,
Severity: Major
Found in app/assets/javascripts/reducers/wiki_courses.js and 4 other locations - About 2 hrs to fix
app/assets/javascripts/reducers/active_courses.js on lines 29..44
app/assets/javascripts/reducers/campaigns.js on lines 56..71
app/assets/javascripts/reducers/course_search_results.js on lines 30..45
app/assets/javascripts/reducers/tickets.js on lines 117..128

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 85.

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 5 locations. Consider refactoring.
Open

    case SORT_ACTIVE_COURSES: {
      const sorted = sortByKey(
        state.courses,
        action.key,
        state.sort.sortKey,
Severity: Major
Found in app/assets/javascripts/reducers/active_courses.js and 4 other locations - About 2 hrs to fix
app/assets/javascripts/reducers/campaigns.js on lines 56..71
app/assets/javascripts/reducers/course_search_results.js on lines 30..45
app/assets/javascripts/reducers/tickets.js on lines 117..128
app/assets/javascripts/reducers/wiki_courses.js on lines 27..42

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 85.

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 8 locations. Consider refactoring.
Open

const fetchAdminUsersPromise = async () => {
  const response = await request('/settings/all_admins');
  if (!response.ok) {
    logErrorMessage(response);
    const data = await response.text();
Severity: Major
Found in app/assets/javascripts/actions/settings_actions.js and 7 other locations - About 2 hrs to fix
app/assets/javascripts/actions/campaign_actions.js on lines 86..95
app/assets/javascripts/actions/settings_actions.js on lines 334..343
app/assets/javascripts/actions/settings_actions.js on lines 385..395
app/assets/javascripts/actions/settings_actions.js on lines 459..468
app/assets/javascripts/actions/tag_actions.js on lines 29..38
app/assets/javascripts/actions/training_actions.js on lines 11..20
app/assets/javascripts/actions/wizard_actions.js on lines 21..30

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 85.

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 5 locations. Consider refactoring.
Open

    case SORT_ALL_CAMPAIGNS: {
      const sorted = sortByKey(
        state.all_campaigns,
        action.key,
        state.sort.sortKey,
Severity: Major
Found in app/assets/javascripts/reducers/campaigns.js and 4 other locations - About 2 hrs to fix
app/assets/javascripts/reducers/active_courses.js on lines 29..44
app/assets/javascripts/reducers/course_search_results.js on lines 30..45
app/assets/javascripts/reducers/tickets.js on lines 117..128
app/assets/javascripts/reducers/wiki_courses.js on lines 27..42

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 85.

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 8 locations. Consider refactoring.
Open

const fetchAllCampaignsPromise = async () => {
  const response = await request('/lookups/campaign.json');
  if (!response.ok) {
    logErrorMessage(response);
    const data = await response.text();
Severity: Major
Found in app/assets/javascripts/actions/campaign_actions.js and 7 other locations - About 2 hrs to fix
app/assets/javascripts/actions/settings_actions.js on lines 15..24
app/assets/javascripts/actions/settings_actions.js on lines 334..343
app/assets/javascripts/actions/settings_actions.js on lines 385..395
app/assets/javascripts/actions/settings_actions.js on lines 459..468
app/assets/javascripts/actions/tag_actions.js on lines 29..38
app/assets/javascripts/actions/training_actions.js on lines 11..20
app/assets/javascripts/actions/wizard_actions.js on lines 21..30

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 85.

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 8 locations. Consider refactoring.
Open

const fetchFeaturedCampaignsPromise = async () => {
  const response = await request('/campaigns/featured_campaigns');
  if (!response.ok) {
    logErrorMessage(response);
    const data = await response.text();
Severity: Major
Found in app/assets/javascripts/actions/settings_actions.js and 7 other locations - About 2 hrs to fix
app/assets/javascripts/actions/campaign_actions.js on lines 86..95
app/assets/javascripts/actions/settings_actions.js on lines 15..24
app/assets/javascripts/actions/settings_actions.js on lines 334..343
app/assets/javascripts/actions/settings_actions.js on lines 385..395
app/assets/javascripts/actions/tag_actions.js on lines 29..38
app/assets/javascripts/actions/training_actions.js on lines 11..20
app/assets/javascripts/actions/wizard_actions.js on lines 21..30

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 85.

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 8 locations. Consider refactoring.
Open

const fetchAllTrainingModulesPromise = async () => {
  const response = await request('/training_modules.json');
  if (!response.ok) {
    logErrorMessage(response);
    const data = await response.text();
Severity: Major
Found in app/assets/javascripts/actions/training_actions.js and 7 other locations - About 2 hrs to fix
app/assets/javascripts/actions/campaign_actions.js on lines 86..95
app/assets/javascripts/actions/settings_actions.js on lines 15..24
app/assets/javascripts/actions/settings_actions.js on lines 334..343
app/assets/javascripts/actions/settings_actions.js on lines 385..395
app/assets/javascripts/actions/settings_actions.js on lines 459..468
app/assets/javascripts/actions/tag_actions.js on lines 29..38
app/assets/javascripts/actions/wizard_actions.js on lines 21..30

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 85.

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 5 locations. Consider refactoring.
Open

    case SORT_TICKETS: {
      const sorted = sortByKey(state.all, action.key, state.sort.sortKey, SORT_DESCENDING[action.key]);

      return {
        ...state,
Severity: Major
Found in app/assets/javascripts/reducers/tickets.js and 4 other locations - About 2 hrs to fix
app/assets/javascripts/reducers/active_courses.js on lines 29..44
app/assets/javascripts/reducers/campaigns.js on lines 56..71
app/assets/javascripts/reducers/course_search_results.js on lines 30..45
app/assets/javascripts/reducers/wiki_courses.js on lines 27..42

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 85.

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 8 locations. Consider refactoring.
Open

const fetchWizardIndexPromise = async () => {
  const response = await request('/wizards.json');
  if (!response.ok) {
    logErrorMessage(response);
    const data = await response.text();
Severity: Major
Found in app/assets/javascripts/actions/wizard_actions.js and 7 other locations - About 2 hrs to fix
app/assets/javascripts/actions/campaign_actions.js on lines 86..95
app/assets/javascripts/actions/settings_actions.js on lines 15..24
app/assets/javascripts/actions/settings_actions.js on lines 334..343
app/assets/javascripts/actions/settings_actions.js on lines 385..395
app/assets/javascripts/actions/settings_actions.js on lines 459..468
app/assets/javascripts/actions/tag_actions.js on lines 29..38
app/assets/javascripts/actions/training_actions.js on lines 11..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 85.

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

export const notifyOverdue = courseSlug => (dispatch) => {
  return API.notifyOverdue(courseSlug)
    .then(data => dispatch({ type: 'NOTIFIED_OVERDUE', data }))
    .catch(data => dispatch({ type: API_FAIL, data }));
};
Severity: Major
Found in app/assets/javascripts/actions/course_actions.js and 1 other location - About 2 hrs to fix
app/assets/javascripts/actions/course_actions.js on lines 138..142

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 85.

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

export const deleteBlock = blockId => (dispatch) => {
  return deleteBlockPromise(blockId)
    .then(data => dispatch({ type: DELETE_BLOCK, blockId: data.block_id }))
    .catch(data => dispatch({ type: API_FAIL, data }));
};
Severity: Major
Found in app/assets/javascripts/actions/timeline_actions.js and 1 other location - About 2 hrs to fix
app/assets/javascripts/actions/timeline_actions.js on lines 47..54

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 85.

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

export const deleteCourse = courseSlug => (dispatch) => {
  return API.deleteCourse(courseSlug)
    .then(data => dispatch({ type: 'DELETED_COURSE', data }))
    .catch(data => dispatch({ type: API_FAIL, data }));
};
Severity: Major
Found in app/assets/javascripts/actions/course_actions.js and 1 other location - About 2 hrs to fix
app/assets/javascripts/actions/course_actions.js on lines 144..148

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 85.

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

        {
          name: 'density',
          source: 'points',
          transform: [
            {
app/assets/javascripts/components/articles/course_quality_progress_graph.jsx on lines 163..179

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 85.

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

export const getFilteredAlerts = createSelector(
  [getAlerts, getAlertFilters], (alerts, alertFilters) => {
    if (!alertFilters.length) { return alerts; }
    const alertTypes = alertFilters.map(_filter => _filter.value);
    return filter(alerts, alert => includes(alertTypes, alert.type));
Severity: Major
Found in app/assets/javascripts/selectors/index.js and 1 other location - About 2 hrs to fix
app/assets/javascripts/selectors/index.js on lines 234..240

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 85.

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

        {
          name: 'density_after',
          source: 'points',
          transform: [
            {
app/assets/javascripts/components/articles/course_quality_progress_graph.jsx on lines 146..162

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 85.

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

export const deleteAllWeeks = courseId => (dispatch) => {
  return API.deleteAllWeeks(courseId)
    .then(data => dispatch({ type: DELETE_ALL_WEEKS, data }))
    .catch(data => dispatch({ type: API_FAIL, data }));
};
Severity: Major
Found in app/assets/javascripts/actions/timeline_actions.js and 1 other location - About 2 hrs to fix
app/assets/javascripts/actions/user_profile_actions.js on lines 4..8

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 85.

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

export const getFilteredUploads = createSelector(
  [getUploads, getUploadFilters], (uploads, uploadFilters) => {
    if (!uploadFilters.length) { return uploads; }
    const uploaders = uploadFilters.map(_filter => _filter.value);
    return filter(uploads, upload => includes(uploaders, upload.uploader));
Severity: Major
Found in app/assets/javascripts/selectors/index.js and 1 other location - About 2 hrs to fix
app/assets/javascripts/selectors/index.js on lines 196..202

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 85.

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

export const fetchStats = username => (dispatch) => {
  return API.fetchUserProfileStats(username)
    .then(resp => dispatch({ type: RECEIVE_USER_PROFILE_STATS, data: resp }))
    .catch(resp => dispatch({ type: API_FAIL, data: resp }));
};
Severity: Major
Found in app/assets/javascripts/actions/user_profile_actions.js and 1 other location - About 2 hrs to fix
app/assets/javascripts/actions/timeline_actions.js on lines 108..112

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 85.

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