atsid/gcal-leave-scraper

View on GitHub

Showing 8 of 82 total issues

TimelineToolbar has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

const TimelineToolbar = React.createClass({
  propTypes: {
    onToolbarChange: React.PropTypes.func,
  },

Severity: Minor
Found in client/components/timeline/TimelineToolbar.js - About 2 hrs to fix

    Function getDateFromStore has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      getDateFromStore() {
        const selected = 10;
        const ranges = [
          {
            id: 10,
    Severity: Minor
    Found in client/components/timeline/TimelineToolbar.js - About 1 hr to fix

      Function _stringContainsFromList has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

        _stringContainsFromList(string, filterString) {
          let match = false;
          if (filterString) {
            const filters = filterString.split(',');
            if (string) {
      Severity: Minor
      Found in client/stores/Calendars.js - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function _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

        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 _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

        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

          Function exports has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          module.exports = (value) => {
            if (typeof value === 'string') {
              const match = value.match(regexIso8601);
              if (match) {
                const milliseconds = Date.parse(match[0]);
          Severity: Minor
          Found in server/initialization/sections/bodyParsing/parseIso8601Date.js - About 25 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

          Severity
          Category
          Status
          Source
          Language