mambax7/extcal

View on GitHub
include/agenda_fnc.php

Summary

Maintainability
D
2 days
Test Coverage

Method getNavBarTabs has 115 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function getNavBarTabs($currentTab = '')
{
    /** @var Helper $helper */
    $helper = Helper::getInstance();

Severity: Major
Found in include/agenda_fnc.php - About 4 hrs to fix

    Function getNavBarTabs has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

    function getNavBarTabs($currentTab = '')
    {
        /** @var Helper $helper */
        $helper = Helper::getInstance();
    
    
    Severity: Minor
    Found in include/agenda_fnc.php - About 4 hrs 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

    File agenda_fnc.php has 304 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * classGenerator
     * walls_watermarks.
     *
    Severity: Minor
    Found in include/agenda_fnc.php - About 3 hrs to fix

      Method agenda_getCanevas has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function agenda_getCanevas($ts, $hStart, $hEnd, $mPlage = 15, $nbJours = 1, $formatDate = '', $formatJour = 'H:i')
      {
          $helper = Helper::getInstance();
          $jour   = date('d', $ts);
          $mois   = date('m', $ts);
      Severity: Major
      Found in include/agenda_fnc.php - About 2 hrs to fix

        Method agenda_getEvents has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            $eventsArray,
            $ts,
            $hStart,
            $hEnd,
            $mPlage = 15,
        Severity: Major
        Found in include/agenda_fnc.php - About 1 hr to fix

          Method agenda_getCanevas has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function agenda_getCanevas($ts, $hStart, $hEnd, $mPlage = 15, $nbJours = 1, $formatDate = '', $formatJour = 'H:i')
          Severity: Major
          Found in include/agenda_fnc.php - About 50 mins to fix

            Function agenda_getCanevas has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            function agenda_getCanevas($ts, $hStart, $hEnd, $mPlage = 15, $nbJours = 1, $formatDate = '', $formatJour = 'H:i')
            {
                $helper = Helper::getInstance();
                $jour   = date('d', $ts);
                $mois   = date('m', $ts);
            Severity: Minor
            Found in include/agenda_fnc.php - 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

            Method getListYears has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function getListYears($year, $nbYearsBefore = 0, $nbYearsAfter = 5, $addNone = false, $name = 'year')
            Severity: Minor
            Found in include/agenda_fnc.php - About 35 mins to fix

              There are no issues that match your filters.

              Category
              Status