qcminecraft/Carbon-Forum-F

View on GitHub

Showing 851 of 851 total issues

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

                var $li = $('<li id="' + file.id + '">' +
                        '<p class="title">' + file.name + '</p>' +
                        '<p class="imgWrap"></p>' +
                        '<p class="progress"><span></span></p>' +
                        '</li>'),
Severity: Major
Found in static/editor/dialogs/video/video.js and 2 other locations - About 1 day to fix
static/editor/dialogs/attachment/attachment.js on lines 182..215
static/editor/dialogs/image/image.js on lines 402..435

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

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

$("#SendMessageButton").click(function () {
    $("#SendMessageButton").val(Lang['Submitting']);
    $.ajax({
        url: WebsitePath + '/inbox/' + $('#InboxID').val(),
        type: 'POST',
Severity: Major
Found in static/js/default/inbox.js and 1 other location - About 1 day to fix
static/js/mobile/inbox.js on lines 50..76

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

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

File common.php has 668 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/*
 * Carbon-Forum-F
 * https://github.com/lincanbin/Carbon-Forum
 *
Severity: Major
Found in common.php - About 1 day to fix

    Method Initialize has 300 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function Initialize()
        {
            //extension_loaded('gd')
            $Width  = $this->AvatarSize;//Width of avatar
            $Height = $this->AvatarSize;//Height of avatar
    Severity: Major
    Found in library/MaterialDesign.Avatars.class.php - About 1 day to fix

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

                      file.on('statuschange', function (cur, prev) {
                          if (prev === 'progress') {
                              $prgress.hide().width(0);
                          } else if (prev === 'queued') {
                              $li.off('mouseenter mouseleave');
      Severity: Major
      Found in static/editor/dialogs/image/image.js and 2 other locations - About 1 day to fix
      static/editor/dialogs/attachment/attachment.js on lines 251..273
      static/editor/dialogs/video/video.js on lines 477..499

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

      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 3 locations. Consider refactoring.
      Open

                      file.on('statuschange', function (cur, prev) {
                          if (prev === 'progress') {
                              $prgress.hide().width(0);
                          } else if (prev === 'queued') {
                              $li.off('mouseenter mouseleave');
      Severity: Major
      Found in static/editor/dialogs/video/video.js and 2 other locations - About 1 day to fix
      static/editor/dialogs/attachment/attachment.js on lines 251..273
      static/editor/dialogs/image/image.js on lines 466..488

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

      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 3 locations. Consider refactoring.
      Open

                      file.on('statuschange', function (cur, prev) {
                          if (prev === 'progress') {
                              $prgress.hide().width(0);
                          } else if (prev === 'queued') {
                              $li.off('mouseenter mouseleave');
      Severity: Major
      Found in static/editor/dialogs/attachment/attachment.js and 2 other locations - About 1 day to fix
      static/editor/dialogs/image/image.js on lines 466..488
      static/editor/dialogs/video/video.js on lines 477..499

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

      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

      File attachment.js has 625 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * User: Jinqn
       * Date: 14-04-08
       * Time: 下午16:34
       * 上传图片对话框逻辑代码,包括tab: 远程图片/上传图片/在线图片/搜索图片
      Severity: Major
      Found in static/editor/dialogs/attachment/attachment.js - About 1 day to fix

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

                    function updateStatus() {
                        var text = '', stats;
        
                        if (state === 'ready') {
                            text = lang.updateStatusReady.replace('_', fileCount).replace('_KB', WebUploader.formatSize(fileSize));
        Severity: Major
        Found in static/editor/dialogs/attachment/attachment.js and 2 other locations - About 1 day to fix
        static/editor/dialogs/image/image.js on lines 632..654
        static/editor/dialogs/video/video.js on lines 643..665

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

        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 3 locations. Consider refactoring.
        Open

                    function updateStatus() {
                        var text = '', stats;
        
                        if (state === 'ready') {
                            text = lang.updateStatusReady.replace('_', fileCount).replace('_KB', WebUploader.formatSize(fileSize));
        Severity: Major
        Found in static/editor/dialogs/video/video.js and 2 other locations - About 1 day to fix
        static/editor/dialogs/attachment/attachment.js on lines 417..439
        static/editor/dialogs/image/image.js on lines 632..654

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

        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 3 locations. Consider refactoring.
        Open

                    function updateStatus() {
                        var text = '', stats;
        
                        if (state === 'ready') {
                            text = lang.updateStatusReady.replace('_', fileCount).replace('_KB', WebUploader.formatSize(fileSize));
        Severity: Major
        Found in static/editor/dialogs/image/image.js and 2 other locations - About 1 day to fix
        static/editor/dialogs/attachment/attachment.js on lines 417..439
        static/editor/dialogs/video/video.js on lines 643..665

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

        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

        File video.js has 622 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /**
         * Created by JetBrains PhpStorm.
         * User: taoqili
         * Date: 12-2-20
         * Time: 上午11:19
        Severity: Major
        Found in static/editor/dialogs/video/video.js - About 1 day to fix

          File scrawl.js has 616 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /**
           * Created with JetBrains PhpStorm.
           * User: xuheng
           * Date: 12-5-22
           * Time: 上午11:38
          Severity: Major
          Found in static/editor/dialogs/scrawl/scrawl.js - About 1 day to fix

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

                rangeSelector: {
                    buttonTheme: {
                        fill: {
                            linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
                            stops: [
            Severity: Major
            Found in static/editor/third-party/highcharts/themes/gray.js and 2 other locations - About 1 day to fix
            static/editor/third-party/highcharts/themes/dark-blue.js on lines 151..201
            static/editor/third-party/highcharts/themes/dark-green.js on lines 152..202

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

            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 3 locations. Consider refactoring.
            Open

                rangeSelector: {
                    buttonTheme: {
                        fill: {
                            linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
                            stops: [
            Severity: Major
            Found in static/editor/third-party/highcharts/themes/dark-blue.js and 2 other locations - About 1 day to fix
            static/editor/third-party/highcharts/themes/dark-green.js on lines 152..202
            static/editor/third-party/highcharts/themes/gray.js on lines 154..204

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

            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 3 locations. Consider refactoring.
            Open

                rangeSelector: {
                    buttonTheme: {
                        fill: {
                            linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
                            stops: [
            Severity: Major
            Found in static/editor/third-party/highcharts/themes/dark-green.js and 2 other locations - About 1 day to fix
            static/editor/third-party/highcharts/themes/dark-blue.js on lines 151..201
            static/editor/third-party/highcharts/themes/gray.js on lines 154..204

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

            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

            File PHPMailer.smtp.class.php has 614 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * PHPMailer RFC821 SMTP email transport class.
             * PHP Version 5
             * @package PHPMailer
            Severity: Major
            Found in library/PHPMailer.smtp.class.php - About 1 day to fix

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

                      if (EnableNotification && window.Notification && Notification.permission !== "denied") {
                          Notification.requestPermission(function(Status) { // 请求权限
                              if (Status === 'granted') {
                                  // 弹出一个通知
                                  var CarbonNotification = new Notification(Lang["New_Message"].replace("{{NewMessage}}", NewMessageNumber), {
              Severity: Major
              Found in static/js/default/global.js and 1 other location - About 1 day to fix
              static/js/mobile/global.js on lines 253..276

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

              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

                      if (EnableNotification && window.Notification && Notification.permission !== "denied") {
                          Notification.requestPermission(function(Status) { // 请求权限
                              if (Status === 'granted') {
                                  // 弹出一个通知
                                  var CarbonNotification = new Notification(Lang["New_Message"].replace("{{NewMessage}}", NewMessageNumber), {
              Severity: Major
              Found in static/js/mobile/global.js and 1 other location - About 1 day to fix
              static/js/default/global.js on lines 342..365

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

              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

              File manage.php has 574 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              require(LanguagePath . 'manage.php');
              SetStyle('api', 'API');
              
              $ID     = intval(Request('Post', 'ID', 0));
              Severity: Major
              Found in controller/manage.php - About 1 day to fix
                Severity
                Category
                Status
                Source
                Language