XoopsModules25x/tdmpicture

View on GitHub

Showing 339 of 339 total issues

File jquery-1.4.4.js has 4965 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jQuery JavaScript Library v1.4.4
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
Severity: Major
Found in assets/js/jquery-1.4.4.js - About 2 wks to fix

    Function Jcrop has 855 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        $.Jcrop = function (obj, opt) {
            // Initialization {{{
    
            // Sanitize some options {{{
            var obj = obj, opt = opt;
    Severity: Major
    Found in assets/js/jquery.Jcrop.js - About 4 days to fix

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

              if ($type_page == 1) {
                  //A4
                  if ($method1 == 1) {
                      $pdf = new PDF('P', 'mm', 'A4');
                      for ($l = 0; $l < $ticket_nb_pages; ++$l) {
      Severity: Major
      Found in include/pdf_paper.php and 1 other location - About 3 days to fix
      include/pdf_paper.php on lines 309..391

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

      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

              } else {
                  if ($method2 == 1) {
                      $pdf = new PDF('P', 'mm', 'A3');
                      for ($l = 0; $l < $ticket_nb_pages; ++$l) {
                          $pdf->AddPage();
      Severity: Major
      Found in include/pdf_paper.php and 1 other location - About 3 days to fix
      include/pdf_paper.php on lines 228..391

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

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

          var jQuery = (function () {
      
      // Define a local copy of jQuery
              var jQuery = function (selector, context) {
                      // The jQuery object is actually just the init constructor 'enhanced'
      Severity: Major
      Found in assets/js/jquery-1.4.4.js - About 2 days to fix

        File jquery.Jcrop.js has 876 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /**
         * jquery.Jcrop.js v0.9.8
         * jQuery Image Cropping Plugin
         * @author Kelly Hallman <khallman@gmail.com>
         * Copyright (c) 2008-2009 Kelly Hallman - released under MIT License {{{
        Severity: Major
        Found in assets/js/jquery.Jcrop.js - About 2 days to fix

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

                  foreach ($_FILES['tdmfile']['error'] as $key => $value) {
                      if ($uploader->fetchMedia('tdmfile', $key)) {
                          $uploader->setPrefix('picture_');
                          $uploader->fetchMedia('tdmfile', $key);
                          if (!$uploader->upload()) {
          Severity: Major
          Found in submit.php and 1 other location - About 1 day to fix
          admin/files.php on lines 101..140

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

          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

                  foreach ($_FILES['tdmfile']['error'] as $key => $value) {
                      if ($uploader->fetchMedia('tdmfile', $key)) {
                          $uploader->setPrefix('picture_');
                          $uploader->fetchMedia('tdmfile', $key);
                          if (!$uploader->upload()) {
          Severity: Major
          Found in admin/files.php and 1 other location - About 1 day to fix
          submit.php on lines 162..200

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

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

              public function getVisualization($output)
              {
                  $width          = $this->visual_width;
                  $height         = $this->visual_height;
                  $height_channel = $height / $this->wave_channels;
          Severity: Minor
          Found in class/classAudioFile.php - About 1 day 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 classAudioFile.php has 690 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          /**
           * ****************************************************************************
           *  - TDMPicture By TDM   - TEAM DEV MODULE FOR XOOPS
          Severity: Major
          Found in class/classAudioFile.php - About 1 day to fix

            Function getSampleInfo has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getSampleInfo()
                {
                    $valid = true;
            
                    if (false !== strpos(strtoupper($this->wave_filename), 'MP3')) {
            Severity: Minor
            Found in class/classAudioFile.php - About 1 day 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

                public function _makeSelBoxOptions($fieldName, $selected, $key, &$ret, $prefix_orig, $prefix_curr = '', $perm)
                {
                    global $start, $tris, $limit, $groups, $xoopsUser, $xoopsModule;
            
                    //perm
            Severity: Major
            Found in class/tree2.php and 1 other location - About 1 day to fix
            class/tree.php on lines 177..211

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

            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 _makeSelBoxOptions($fieldName, $selected, $key, &$ret, $prefix_orig, $prefix_curr = '', $perm)
                {
                    global $start, $tris, $limit, $groups, $xoopsUser, $xoopsModule;
            
                    //perm
            Severity: Major
            Found in class/tree.php and 1 other location - About 1 day to fix
            class/tree2.php on lines 165..199

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

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

                public function mp3info()
                {
                    $byte             = array();
                    $version          = array('MPEG Version 2.5', false, 'MPEG Version 2', 'MPEG Version 1');
                    $version_bitrate  = array(1, false, 1, 0);
            Severity: Major
            Found in class/classAudioFile.php - About 1 day to fix

              File pdf_paper.php has 660 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              //
              //  ------------------------------------------------------------------------ //
              //                XOOPS - PHP Content Management System                      //
              Severity: Major
              Found in include/pdf_paper.php - About 1 day to fix

                File jquery.colorbox.js has 605 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                // ColorBox v1.3.15 - a full featured, light-weight, customizable lightbox based on jQuery 1.3+
                // Copyright (c) 2010 Jack Moore - jack@colorpowered.com
                // Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
                (function ($, window) {
                
                
                Severity: Major
                Found in assets/js/jquery.colorbox.js - About 1 day to fix

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

                      case 'A3':
                          //load class
                          $fileHandler = xoops_getModuleHandler('file', $moduleDirName);
                          $catHandler  = xoops_getModuleHandler('category', $moduleDirName);
                  
                  
                  Severity: Major
                  Found in pdf_paper.php and 3 other locations - About 1 day to fix
                  pdf_paper.php on lines 168..197
                  pdf_paper.php on lines 230..259
                  pdf_paper.php on lines 261..290

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

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

                      case 'A1':
                          //load class
                          $fileHandler = xoops_getModuleHandler('file', $moduleDirName);
                          $catHandler  = xoops_getModuleHandler('category', $moduleDirName);
                  
                  
                  Severity: Major
                  Found in pdf_paper.php and 3 other locations - About 1 day to fix
                  pdf_paper.php on lines 168..197
                  pdf_paper.php on lines 199..228
                  pdf_paper.php on lines 230..259

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

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

                      case 'A2':
                          //load class
                          $fileHandler = xoops_getModuleHandler('file', $moduleDirName);
                          $catHandler  = xoops_getModuleHandler('category', $moduleDirName);
                  
                  
                  Severity: Major
                  Found in pdf_paper.php and 3 other locations - About 1 day to fix
                  pdf_paper.php on lines 168..197
                  pdf_paper.php on lines 199..228
                  pdf_paper.php on lines 261..290

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

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

                      case 'A4':
                          //load class
                          $fileHandler = xoops_getModuleHandler('file', $moduleDirName);
                          $catHandler  = xoops_getModuleHandler('category', $moduleDirName);
                  
                  
                  Severity: Major
                  Found in pdf_paper.php and 3 other locations - About 1 day to fix
                  pdf_paper.php on lines 199..228
                  pdf_paper.php on lines 230..259
                  pdf_paper.php on lines 261..290

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

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language