mambax7/extcal

View on GitHub

Showing 1,163 of 1,163 total issues

Method TrDisplay has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function TrDisplay()
    {
        global $g_pcl_trace_level;
        global $g_pcl_trace_mode;
        global $g_pcl_trace_filename;
Severity: Major
Found in class/pcltrace.lib.php - About 2 hrs to fix

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

            getElementByClass: function (el, tagName, className) {
                var els = el.getElementsByTagName(tagName);
                for (var i = 0; i < els.length; i++) {
                    if ((new RegExp(className)).test(els[i].className)) {
                        return els[i];
    Severity: Major
    Found in assets/js/highslide-full.js and 1 other location - About 2 hrs to fix
    assets/js/highslide-with-gallery.js on lines 293..301

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

    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

            getElementByClass: function (el, tagName, className) {
                var els = el.getElementsByTagName(tagName);
                for (var i = 0; i < els.length; i++) {
                    if ((new RegExp(className)).test(els[i].className)) {
                        return els[i];
    Severity: Major
    Found in assets/js/highslide-with-gallery.js and 1 other location - About 2 hrs to fix
    assets/js/highslide-full.js on lines 370..378

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

    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

    Calendar_Engine_PearDate has 25 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Calendar_Engine_PearDate /* implements Calendar_Engine_Interface */
    {
        /**
         * Makes sure a given timestamp is only ever parsed once
         * Uses a static variable to prevent date() being used twice
    Severity: Minor
    Found in class/pear/Calendar/Engine/PearDate.php - About 2 hrs to fix

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

          public function addCatPermCriteria(\CriteriaCompo $criteria, $user)
          {
              $authorizedAccessCats = $this->extcalPerm->getAuthorizedCat($user, 'extcal_cat_view');
              $count                = \count($authorizedAccessCats);
              if ($count > 0) {
      Severity: Major
      Found in class/EventHandler.php and 1 other location - About 2 hrs to fix
      class/CategoryHandler.php on lines 183..198

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

      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

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

          public function addCatPermCriteria(\CriteriaCompo $criteria, $user, $perm = 'extcal_cat_view')
          {
              $authorizedAccessCats = $this->extcalPerm->getAuthorizedCat($user, 'extcal_cat_view');
              $count                = \count($authorizedAccessCats);
              if ($count > 0) {
      Severity: Major
      Found in class/CategoryHandler.php and 1 other location - About 2 hrs to fix
      class/EventHandler.php on lines 853..868

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

      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 (!empty($event_picture1)) {
                      $file_tray->addElement(new \XoopsFormLabel('', "<img src='" . XOOPS_URL . '/uploads/extcal/' . $event_picture1 . "' name='image' id='image' alt=''><br><br>"));
                      $check_del_img = new \XoopsFormCheckBox('', 'delimg_1');
                      $check_del_img->addOption(1, \_MD_EXTCAL_DEL_IMG);
                      $file_tray->addElement($check_del_img);
      Severity: Major
      Found in class/EventHandler.php and 1 other location - About 2 hrs to fix
      class/EventHandler.php on lines 1274..1283

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

      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 (!empty($event_picture2)) {
                      $file_tray->addElement(new \XoopsFormLabel('', "<img src='" . XOOPS_URL . '/uploads/extcal/' . $event_picture2 . "' name='image' id='image' alt=''><br><br>"));
                      $check_del_img = new \XoopsFormCheckBox('', 'delimg_2');
                      $check_del_img->addOption(1, \_MD_EXTCAL_DEL_IMG);
                      $file_tray->addElement($check_del_img);
      Severity: Major
      Found in class/EventHandler.php and 1 other location - About 2 hrs to fix
      class/EventHandler.php on lines 1254..1263

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

      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

      Method PclTarHandleAddList has 69 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function PclTarHandleAddList($p_tar, $p_list, $p_mode, &$p_list_detail, $p_add_dir, $p_remove_dir)
          {
              TrFctStart(__FILE__, __LINE__, 'PclTarHandleAddList', "tar='$p_tar', list, mode='$p_mode', add_dir='$p_add_dir', remove_dir='$p_remove_dir'");
              $v_result = 1;
              $v_header = [];
      Severity: Major
      Found in class/pcltar.lib.php - About 2 hrs to fix

        Function wrapperMouseHandler has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

                wrapperMouseHandler: function (e) {
                    try {
                        if (!e) e = window.event;
                        var over = /mouseover/i.test(e.type);
                        if (!e.target) e.target = e.srcElement; // ie
        Severity: Minor
        Found in assets/js/highslide-full.js - 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 updateAnchors has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

                updateAnchors: function () {
                    var el, els, all = [], images = [], groups = {}, re;
        
                    for (var i = 0; i < hs.openerTagNames.length; i++) {
                        els = document.getElementsByTagName(hs.openerTagNames[i]);
        Severity: Minor
        Found in assets/js/highslide.js - 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 contentLoaded has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

                contentLoaded: function () {
                    try {
                        if (!this.content) return;
                        this.content.onload = null;
                        if (this.onLoadStarted) return;
        Severity: Minor
        Found in assets/js/highslide.js - 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 updateAnchors has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

                updateAnchors: function () {
                    var el, els, all = [], images = [], groups = {}, re;
        
                    for (var i = 0; i < hs.openerTagNames.length; i++) {
                        els = document.getElementsByTagName(hs.openerTagNames[i]);
        Severity: Minor
        Found in assets/js/highslide-with-gallery.js - 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 getOverlays has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

                getOverlays: function () {
                    this.getInline(['heading', 'caption'], true);
                    this.getNumber();
                    if (this.heading && this.dragByHeading) this.heading.className += ' highslide-move';
                    if (hs.showCredits) this.writeCredits();
        Severity: Minor
        Found in assets/js/highslide-with-gallery.js - 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 positionOverlay has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

                positionOverlay: function (overlay) {
                    var p = overlay.position || 'middle center',
                        offX = overlay.offsetX,
                        offY = overlay.offsetY;
                    if (overlay.parentNode != this.overlayBox) this.overlayBox.appendChild(overlay);
        Severity: Minor
        Found in assets/js/highslide.js - 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 isBlockCloned has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

            function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options)
            {
                xoops_loadLanguage('admin', 'system');
                xoops_loadLanguage('admin/blocksadmin', 'system');
                xoops_loadLanguage('admin/groups', 'system');
        Severity: Minor
        Found in admin/blocksadmin.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 convertResultSet has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

            public function convertResultSet($result, $idAsKey = false, $asObject = true)
            {
                $ret = [];
                while (false !== ($myrow = $this->db->fetchArray($result))) {
                    $obj = $this->create(false);
        Severity: Minor
        Found in class/ExtcalPersistableObjectHandler.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

        File Time.php has 281 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        namespace XoopsModules\Extcal;
        
        use XoopsModules\Extcal\{Helper
        Severity: Minor
        Found in class/Time.php - About 2 hrs to fix

          File Calendar.php has 280 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
          
          /**
          Severity: Minor
          Found in class/pear/Calendar/Calendar.php - About 2 hrs to fix

            Method getSearchEvents has 67 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getSearchEvents(
                    $year = 0,
                    $month = 0,
                    $day = 0,
                    $cat = 0,
            Severity: Major
            Found in class/EventHandler.php - About 2 hrs to fix
              Severity
              Category
              Status
              Source
              Language