frogsystem/fs2-core

View on GitHub

Showing 1,108 of 1,108 total issues

File codemirror.js has 8129 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! Frogsystem2 - v2.0.0-alix7 - 2015-01-28
* https://github.com/mrgrain/Frogsystem-2
* Copyright (c) 2015 ; Licensed CC BY-SA 3.0 DE */
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
Severity: Major
Found in www/admin/js/codemirror.js - About 3 wks to fix

    File admin.js has 8083 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*! Frogsystem2 - v2.0.0-alix7 - 2015-01-28
    * https://github.com/mrgrain/Frogsystem-2
    * Copyright (c) 2015 ; Licensed CC BY-SA 3.0 DE */
    /*!
     * jQuery JavaScript Library v1.11.2
    Severity: Major
    Found in www/admin/js/admin.js - About 3 wks to fix

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

      $().ready(function(){
      
      var lastJQBox;
      
      //////////////////////////////
      Severity: Major
      Found in www/admin/js/admin.js and 1 other location - About 1 wk to fix
      assets/js/admin/_functions.js on lines 4..146

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

      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

      $().ready(function(){
      
      var lastJQBox;
      
      //////////////////////////////
      Severity: Major
      Found in assets/js/admin/_functions.js and 1 other location - About 1 wk to fix
      www/admin/js/admin.js on lines 11384..11526

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

      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 Sizzle has 1355 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      (function( window ) {
      
      var i,
          support,
          Expr,
      Severity: Major
      Found in www/admin/js/admin.js - About 6 days to fix

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

            if (isset($_POST['sended'])) {
        
                //add link
                if (isset($_POST['add_link'])) {
                    if (!empty($_POST['new_link_name']) && !empty($_POST['new_link_url']) && !in_array($_POST['new_link_url'], array('http://', 'https://'))) {
        Severity: Major
        Found in www/admin/admin_news_add.php and 1 other location - About 5 days to fix
        www/admin/admin_news_edit.php on lines 608..702

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

        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 (isset($_POST['sended'])) {
        
                    //add link
                    if (isset($_POST['add_link'])) {
                        if (!empty($_POST['new_link_name']) && !empty($_POST['new_link_url']) && !in_array($_POST['new_link_url'], array('http://', 'https://'))) {
        Severity: Major
        Found in www/admin/admin_news_edit.php and 1 other location - About 5 days to fix
        www/admin/admin_news_add.php on lines 140..218

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

        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

        function changeDate (dayID, monthID, yearID, hourID, minID, dayShift, monthShift, yearShift, hourShift, minShift)
        {
            var oldDate = new Date(parseInt(document.getElementById(yearID).value, 10),
                                   parseInt(document.getElementById(monthID).value, 10) - 1,
                                   parseInt(document.getElementById(dayID).value, 10),
        Severity: Major
        Found in assets/js/admin/_functions.js and 1 other location - About 5 days to fix
        www/admin/js/admin.js on lines 11766..11826

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

        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

        function changeDate (dayID, monthID, yearID, hourID, minID, dayShift, monthShift, yearShift, hourShift, minShift)
        {
            var oldDate = new Date(parseInt(document.getElementById(yearID).value, 10),
                                   parseInt(document.getElementById(monthID).value, 10) - 1,
                                   parseInt(document.getElementById(dayID).value, 10),
        Severity: Major
        Found in www/admin/js/admin.js and 1 other location - About 5 days to fix
        assets/js/admin/_functions.js on lines 386..446

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

        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 class_StringParser_BBCode.php has 1219 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /**
         * BB code string parsing class
         *
         * Version: 0.3.3
        Severity: Major
        Found in www/libs/class_StringParser_BBCode.php - About 3 days to fix

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

          $().ready(function(){
          
              //~ Remove No Script CSS
              $("head > link#noscriptcss").remove();
          
          
          Severity: Major
          Found in assets/js/admin/_admin.js and 1 other location - About 3 days to fix
          www/admin/js/admin.js on lines 11196..11238

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

          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

          $().ready(function(){
          
              //~ Remove No Script CSS
              $("head > link#noscriptcss").remove();
          
          
          Severity: Major
          Found in www/admin/js/admin.js and 1 other location - About 3 days to fix
          assets/js/admin/_admin.js on lines 4..46

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

          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 _handleStatus has a Cognitive Complexity of 146 (exceeds 5 allowed). Consider refactoring.
          Open

              function _handleStatus ($status, $needle) {
                  switch ($status) {
                      case 0: // NORMAL TEXT
                          if ($needle != '[' && $needle != '[/') {
                              $this->_appendText ($needle);
          Severity: Minor
          Found in www/libs/class_StringParser_BBCode.php - About 2 days 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

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

          $(document).ready(function(){
              $('.colorpicker').colpick({
                  layout:'rgbhex',
                  
                  onBeforeShow: function () {
          Severity: Major
          Found in assets/js/admin/_colorpicker.js and 1 other location - About 2 days to fix
          www/admin/js/admin.js on lines 11316..11361

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

          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

          $(document).ready(function(){
              $('.colorpicker').colpick({
                  layout:'rgbhex',
                  
                  onBeforeShow: function () {
          Severity: Major
          Found in www/admin/js/admin.js and 1 other location - About 2 days to fix
          assets/js/admin/_colorpicker.js on lines 4..49

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

          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 ($comment_arr['comment_poster_id'] != 0)
              {
                $index2 = $FD->db()->conn()->query('SELECT `user_name`, `user_is_admin`, `user_is_staff`, `user_group` FROM `'.$FD->env('DB_PREFIX').'user` WHERE user_id = '.$comment_arr['comment_poster_id']);
                $user_arr = $index2->fetch(PDO::FETCH_ASSOC);
                $comment_arr['comment_poster'] = kill_replacements ( $user_arr['user_name'], TRUE );
          Severity: Major
          Found in www/libs/downloads/dlcomments.php and 1 other location - About 2 days to fix
          www/data/comments.php on lines 222..263

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

          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 ($comment_arr['comment_poster_id'] != 0)
                  {
                      $index2 = $FD->db()->conn()->query('SELECT `user_name`, `user_is_admin`, `user_is_staff`, `user_group` FROM `'.$FD->env('DB_PREFIX').'user` WHERE user_id = '.$comment_arr['comment_poster_id']);
                      $row = $index2->fetch(PDO::FETCH_ASSOC);
                      $comment_arr['comment_poster'] = kill_replacements ( $row['user_name'], TRUE );
          Severity: Major
          Found in www/data/comments.php and 1 other location - About 2 days to fix
          www/libs/downloads/dlcomments.php on lines 205..246

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

          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

                  while ( $group_arr = $index->fetch(PDO::FETCH_ASSOC) )
                  {
                      $index_username = $FD->db()->conn()->query ( '
                                              SELECT `user_name`
                                              FROM `'.$FD->env('DB_PREFIX')."user`
          Severity: Major
          Found in www/admin/admin_group_admin.php and 1 other location - About 2 days to fix
          www/admin/admin_group_rights.php on lines 296..340

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

          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

                  while ( $group_arr = $index->fetch(PDO::FETCH_ASSOC) )
                  {
                      $index_username = $FD->db()->conn()->query ( '
                                              SELECT `user_name`
                                              FROM `'.$FD->env('DB_PREFIX')."user`
          Severity: Major
          Found in www/admin/admin_group_rights.php and 1 other location - About 2 days to fix
          www/admin/admin_group_admin.php on lines 495..539

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

          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 parse_fscode has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring.
          Open

          function parse_fscode($TEXT, $flags = array(), $to_html = array(), $to_text = array(), $to_bbcode = array(), $remove = array()) {
          
              /* TODO: to_bbcode
               * Convert "special" frogsystem tags to default bbcode
               * Done: home, cimg, video
          Severity: Minor
          Found in www/libs/includes/fscode.php - About 2 days 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