atsid/react-calendar-render

View on GitHub

Showing 5 of 15 total issues

Function render has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const rowCount = this.getRowCount();
    const tableClassName = classNames('calendar-mv-position');
    const tableClassName2 = classNames('calendar-mv-bg-position');
    const tableCellClassName = classNames('calendar-mv-cell');
Severity: Major
Found in src/CalendarMonthView.js - About 2 hrs to fix

    Function getHeader has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      getHeader() {
        const titleString = this.getTitleString();
        const leftNav = this.getLeftNav();
        const rightNav = this.getRightNav();
        const headerClass = classNames('calendar-header');
    Severity: Minor
    Found in src/CalendarHeader.js - About 1 hr to fix

      Function getHeader has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        getHeader() {
          const titleString = this.getTitleString();
          const leftNav = this.getLeftNav();
          const rightNav = this.getRightNav();
          const headerClass = classNames('calendar-header');
      Severity: Minor
      Found in src/CalendarHeader.js - About 55 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 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 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
          Severity
          Category
          Status
          Source
          Language