mambax7/extcal

View on GitHub
blocks/minical.php

Summary

Maintainability
D
3 days
Test Coverage

Method bExtcalMinicalShow has 134 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function bExtcalMinicalShow($options)
{
    global $xoopsUser;

    extcal_getDefautminicalOption($options);
Severity: Major
Found in blocks/minical.php - About 5 hrs to fix

    File minical.php has 349 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /*
     * You may not change or alter any portion of this comment or credits
     * of supporting developers from this source code or any supporting source code
     * which is considered copyrighted (c) material of the original comment or credit authors.
    Severity: Minor
    Found in blocks/minical.php - About 4 hrs to fix

      Method bExtcalMinicalEdit has 80 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function bExtcalMinicalEdit($options)
      {
          //    // require_once  \dirname(__DIR__) . '/class/form/spin/formspin.php';
          global $xoopsUser;
      
      
      Severity: Major
      Found in blocks/minical.php - About 3 hrs to fix

        Function bExtcalMinicalShow has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

        function bExtcalMinicalShow($options)
        {
            global $xoopsUser;
        
            extcal_getDefautminicalOption($options);
        Severity: Minor
        Found in blocks/minical.php - About 2 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

        Function extcal_getDefautminicalOption has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

        function extcal_getDefautminicalOption(&$options)
        {
            // 0|0|150|225|1|3|10|0|1|1,2|| |120|120
            for ($h = 0; $h <= 13; ++$h) {
                if (!isset($options[$h])) {
        Severity: Minor
        Found in blocks/minical.php - About 2 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

        Method extcal_getDefautminicalOption has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function extcal_getDefautminicalOption(&$options)
        {
            // 0|0|150|225|1|3|10|0|1|1,2|| |120|120
            for ($h = 0; $h <= 13; ++$h) {
                if (!isset($options[$h])) {
        Severity: Minor
        Found in blocks/minical.php - About 1 hr to fix

          Method _makeXMLSlideshowConf has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function _makeXMLSlideshowConf($options)
          {
              // create a  new \XML document
              $doc               = new DomDocument('1.0');
              $doc->formatOutput = true;
          Severity: Minor
          Found in blocks/minical.php - About 1 hr to fix

            Method bExtcalMinicalAddEventToArray has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function bExtcalMinicalAddEventToArray($event, &$eventsArray, $timeHandler, $startMonth, $endMonth, $cats)
            {
                // Utility::echoArray($event);
                // exit;
                // $d1 = date("j, m, Y", $startMonth);
            Severity: Minor
            Found in blocks/minical.php - About 1 hr to fix

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

              function bExtcalMinicalAddEventToArray($event, &$eventsArray, $timeHandler, $startMonth, $endMonth, $cats)
              {
                  // Utility::echoArray($event);
                  // exit;
                  // $d1 = date("j, m, Y", $startMonth);
              Severity: Minor
              Found in blocks/minical.php - 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

              Method bExtcalMinicalAddEventToArray has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function bExtcalMinicalAddEventToArray($event, &$eventsArray, $timeHandler, $startMonth, $endMonth, $cats)
              Severity: Minor
              Found in blocks/minical.php - About 45 mins to fix

                There are no issues that match your filters.

                Category
                Status