atsid/gcal-leave-scraper

View on GitHub

Showing 82 of 82 total issues

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

    return this.context.stores.users.getCurrentUser()
      .then((user) => this.setState({user, loading: false}))
      .catch((err) => {
        debug('error loading store data', err);
        this.setState({loading: false});
Severity: Major
Found in client/components/skeleton/Skeleton.js and 1 other location - About 1 hr to fix
client/components/Dashboard.js on lines 20..22

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

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

const router = jefferson.router({
  routes: {
    '/all': {
      get: [calendar.listAllCalendars],
    },
Severity: Major
Found in server/routers/calendar/index.js and 1 other location - About 1 hr to fix
server/routers/groups/index.js on lines 4..13

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

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

  propTypes: {
    contact: React.PropTypes.object,
    filter: React.PropTypes.string,
    range: React.PropTypes.object,
    onLoaded: React.PropTypes.func,
Severity: Major
Found in client/components/timeline/ContactView.js and 1 other location - About 1 hr to fix
client/components/skeleton/HeaderBar.js on lines 12..17

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

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

  propTypes: {
    user: React.PropTypes.object,
    appBarTitle: React.PropTypes.string,
    onLeftTouchTap: React.PropTypes.func,
    onRightTouchTap: React.PropTypes.func,
Severity: Major
Found in client/components/skeleton/HeaderBar.js and 1 other location - About 1 hr to fix
client/components/timeline/ContactView.js on lines 7..12

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

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 _runTests has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

function _runTests(testGlob, reporter, sourceGlob, reportDir, coverageReporters, tdd, resolve) {
Severity: Major
Found in gulp/tasks/test.js - About 50 mins to fix

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

    module.exports = (req, res) => {
      if (!req.user) {
        errorNoUserFound(res);
      } else {
        fetchGroups(req, res);
    Severity: Major
    Found in server/middleware/group/listAllGroups.js and 5 other locations - About 45 mins to fix
    server/middleware/calendar/listAllCalendarEvents.js on lines 50..56
    server/middleware/calendar/listAllCalendars.js on lines 39..45
    server/middleware/contacts/listAllContacts.js on lines 46..52
    server/middleware/filter/listAllFilters.js on lines 19..25
    server/middleware/group/listAllGroupContacts.js on lines 12..18

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

    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 renderMenu has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      renderMenu(key, items, hasAdd, hasCustom) {
        const menu = [];
        if (items && items.length > 0) {
          items.map((item) => {
            menu.push(<MenuItem
    Severity: Minor
    Found in client/components/timeline/TimelineToolbar.js - About 45 mins 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 runTests has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function runTests(sourceGlob, testGlob, reportDir, reporter = DEFAULT_SPEC_REPORTER, coverageReporters = DEFAULT_COVERAGE_REPORTERS, tdd = false) {
    Severity: Minor
    Found in gulp/tasks/test.js - About 45 mins to fix

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

      module.exports = (req, res) => {
        if (!req.user) {
          errorNoUserFound(res);
        } else {
          fetchAllUsers(req, res);
      Severity: Major
      Found in server/middleware/group/listAllGroupContacts.js and 5 other locations - About 45 mins to fix
      server/middleware/calendar/listAllCalendarEvents.js on lines 50..56
      server/middleware/calendar/listAllCalendars.js on lines 39..45
      server/middleware/contacts/listAllContacts.js on lines 46..52
      server/middleware/filter/listAllFilters.js on lines 19..25
      server/middleware/group/listAllGroups.js on lines 18..24

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

      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

            if (hasAdd) {
              menu.push(<MenuItem key="add" disabled={this.mocked} value="add" primaryText="Add"/>);
            }
      Severity: Minor
      Found in client/components/timeline/TimelineToolbar.js and 1 other location - About 45 mins to fix
      client/components/timeline/TimelineToolbar.js on lines 215..217

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

      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

            if (hasCustom) {
              menu.push(<MenuItem key="custom" disabled={this.mocked} value="custom" primaryText="Custom"/>);
            }
      Severity: Minor
      Found in client/components/timeline/TimelineToolbar.js and 1 other location - About 45 mins to fix
      client/components/timeline/TimelineToolbar.js on lines 212..214

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

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

      module.exports = (req, res) => {
        if (!req.user) {
          errorNoUserFound(res);
        } else {
          fetchAllUsers(req, res);
      Severity: Major
      Found in server/middleware/contacts/listAllContacts.js and 5 other locations - About 45 mins to fix
      server/middleware/calendar/listAllCalendarEvents.js on lines 50..56
      server/middleware/calendar/listAllCalendars.js on lines 39..45
      server/middleware/filter/listAllFilters.js on lines 19..25
      server/middleware/group/listAllGroupContacts.js on lines 12..18
      server/middleware/group/listAllGroups.js on lines 18..24

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

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

      module.exports = (req, res) => {
        if (!req.user) {
          errorNoUserFound(res);
        } else {
          fetchFilters(req, res);
      Severity: Major
      Found in server/middleware/filter/listAllFilters.js and 5 other locations - About 45 mins to fix
      server/middleware/calendar/listAllCalendarEvents.js on lines 50..56
      server/middleware/calendar/listAllCalendars.js on lines 39..45
      server/middleware/contacts/listAllContacts.js on lines 46..52
      server/middleware/group/listAllGroupContacts.js on lines 12..18
      server/middleware/group/listAllGroups.js on lines 18..24

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

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

      module.exports = (req, res) => {
        if (!req.user) {
          errorNoUserFound(res);
        } else {
          fetchAllCalendars(req, res);
      Severity: Major
      Found in server/middleware/calendar/listAllCalendars.js and 5 other locations - About 45 mins to fix
      server/middleware/calendar/listAllCalendarEvents.js on lines 50..56
      server/middleware/contacts/listAllContacts.js on lines 46..52
      server/middleware/filter/listAllFilters.js on lines 19..25
      server/middleware/group/listAllGroupContacts.js on lines 12..18
      server/middleware/group/listAllGroups.js on lines 18..24

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

      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

        handleFilterChange(evt, index, value) {
          if (value !== this.state.selectedFilter) {
            this.stateChange(evt, value, 'filters', {selectedFilter: value});
          }
        },
      Severity: Major
      Found in client/components/timeline/TimelineToolbar.js and 2 other locations - About 45 mins to fix
      client/components/timeline/TimelineToolbar.js on lines 173..177
      client/components/timeline/TimelineToolbar.js on lines 185..189

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

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

      module.exports = (req, res) => {
        if (!req.user) {
          errorNoUserFound(res);
        } else {
          fetchAllCalendarEvents(req, res);
      Severity: Major
      Found in server/middleware/calendar/listAllCalendarEvents.js and 5 other locations - About 45 mins to fix
      server/middleware/calendar/listAllCalendars.js on lines 39..45
      server/middleware/contacts/listAllContacts.js on lines 46..52
      server/middleware/filter/listAllFilters.js on lines 19..25
      server/middleware/group/listAllGroupContacts.js on lines 12..18
      server/middleware/group/listAllGroups.js on lines 18..24

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

      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

        handleGroupChange(evt, index, value) {
          if (value !== this.state.selectedGroup) {
            this.stateChange(evt, value, 'groups', {selectedGroup: value});
          }
        },
      Severity: Major
      Found in client/components/timeline/TimelineToolbar.js and 2 other locations - About 45 mins to fix
      client/components/timeline/TimelineToolbar.js on lines 179..183
      client/components/timeline/TimelineToolbar.js on lines 185..189

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

      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

        handleRangeChange(evt, index, value) {
          if (value !== this.state.selectedRange) {
            this.stateChange(evt, value, 'ranges', {selectedRange: value});
          }
        },
      Severity: Major
      Found in client/components/timeline/TimelineToolbar.js and 2 other locations - About 45 mins to fix
      client/components/timeline/TimelineToolbar.js on lines 173..177
      client/components/timeline/TimelineToolbar.js on lines 179..183

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

      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 _filterBuildCalenarEvents has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        _filterBuildCalenarEvents(userId, events, filter) {
          const results = [];
          for (let index = 0; index < events.length; index++) {
            if (events[index].creator && events[index].creator.email === userId) {
              if (this._stringContainsFromList(events[index].summary, filter) || this._stringContainsFromList(events[index].title, filter)) {
      Severity: Minor
      Found in client/stores/Calendars.js - About 45 mins 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

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

          return this.context.stores.filters.getFilters({})
            .then((filters) => {
              this.setState({
                selectedFilter: filters.selected,
                filters: filters.items,
      Severity: Minor
      Found in client/components/timeline/TimelineToolbar.js and 1 other location - About 35 mins to fix
      client/components/timeline/TimelineToolbar.js on lines 38..49

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

      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