XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

Similar blocks of code found in 3 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/images/js/highslide/highslide-full.js and 2 other locations - About 2 hrs to fix
assets/images/js/highslide/highslide-with-gallery.js on lines 293..301
assets/images/js/highslide/highslide-with-html.js on lines 310..318

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 3 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/images/js/highslide/highslide-with-gallery.js and 2 other locations - About 2 hrs to fix
assets/images/js/highslide/highslide-full.js on lines 370..378
assets/images/js/highslide/highslide-with-html.js on lines 310..318

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

Method get_xoops_search_result has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        public function get_xoops_search_result($keywords, $andor, $limit, $offset, $uid)
        {
            // �����׻�
            $tzoffset = ($this->user_TZ - $this->server_TZ) * 3600;

Severity: Major
Found in class/APCal_xoops.php - About 2 hrs to fix

    Method setOutputFormat has 71 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function setOutputFormat()
        {
            static $alreadyCalled = false;
            if ($this->thumbnailFormat && $alreadyCalled) {
                return true;
    Severity: Major
    Found in thumbs/phpthumb.class.php - About 2 hrs to fix

      Method makeShort has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function makeShort($str)
      {
          $replacements = array(
              'Š' => 'S',
              'š' => 's',
      Severity: Major
      Found in include/oninstall.php - About 2 hrs to fix

        Method makeShort has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function makeShort($str)
        {
            $replacements = array(
                'Š' => 'S',
                'š' => 's',
        Severity: Major
        Found in include/onupdate.php - About 2 hrs to fix

          Method applyUnsharpMask has 70 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function applyUnsharpMask(&$img, $amount, $radius, $threshold)
              {
          
                  // $img is an image that is already created within php using
                  // imgcreatetruecolor. No url! $img must be a truecolor image.
          Severity: Major
          Found in thumbs/phpthumb.unsharp.php - About 2 hrs to fix

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

                    for (var i = 0; i < hs.expanders.length; i++) {
                        if (hs.expanders[i] && hs.expanders[i].a == a) {
                            hs.expanders[i].focus();
                            return false;
                        }
            Severity: Major
            Found in assets/images/js/highslide/highslide-with-html.js and 1 other location - About 2 hrs to fix
            assets/images/js/highslide/highslide.js on lines 1012..1017

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

            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

                    for (var i = 0; i < hs.expanders.length; i++) {
                        if (hs.expanders[i] && hs.expanders[i].a == a) {
                            hs.expanders[i].focus();
                            return false;
                        }
            Severity: Major
            Found in assets/images/js/highslide/highslide.js and 1 other location - About 2 hrs to fix
            assets/images/js/highslide/highslide-with-html.js on lines 1193..1198

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

            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

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

            Calendar.prototype.showAtElement = function (el, opts) {
                var self = this;
                var p = Calendar.getAbsolutePos(el);
                if (!opts || typeof opts != "string") {
                    this.showAt(p.x, p.y + el.offsetHeight);
            Severity: Minor
            Found in assets/js/jscalendar/calendar.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 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/images/js/highslide/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 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/images/js/highslide/highslide-with-html.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/images/js/highslide/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 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/images/js/highslide/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 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/images/js/highslide/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/images/js/highslide/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/images/js/highslide/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 output_setsqls has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

                public function output_setsqls()
                {
                    $rets = array();
            
                    foreach ($this->events as $uid => $event) {
            Severity: Minor
            Found in class/iCal_parser.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 getGD_PixelPlotterVersion has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getGD_PixelPlotterVersion()
                {
                    if (!$this->m_bLoaded) {
                        return false;
                    }
            Severity: Minor
            Found in thumbs/phpthumb.gif.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 get_where_about_categories has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

                    public function get_where_about_categories()
                    {
                        if ($this->isadmin) {
                            if (empty($this->now_cid)) {
                                // �����Ԥ�����Ԥ�$cid���꤬�ʤ���о��True
            Severity: Minor
            Found in class/APCal.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

            Severity
            Category
            Status
            Source
            Language