arastta/arastta

View on GitHub

Showing 4,995 of 7,509 total issues

Function fixCSS has a Cognitive Complexity of 1642 (exceeds 5 allowed). Consider refactoring.
Open

function fixCSS($prop) {
    if (!is_array($prop) || (count($prop)==0)) return array(); 
    $newprop = array(); 
    foreach($prop AS $k => $v) {
        if ($k != 'BACKGROUND-IMAGE' && $k != 'BACKGROUND' && $k != 'ODD-HEADER-NAME' && $k != 'EVEN-HEADER-NAME' && $k != 'ODD-FOOTER-NAME' && $k != 'EVEN-FOOTER-NAME' && $k != 'HEADER' && $k != 'FOOTER') {
Severity: Minor
Found in system/mpdf/classes/cssmgr.php - About 1 mo 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 load has a Cognitive Complexity of 1540 (exceeds 5 allowed). Consider refactoring.
Open

    public function load($pFilename)
    {
        // Check if file exists
        if (!file_exists($pFilename)) {
            throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
Severity: Minor
Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 1 mo 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 jquery.js has 6532 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jQuery JavaScript Library v1.8.3
 * http://jquery.com/
 *
 * Includes Sizzle.js
Severity: Major
Found in admin/view/javascript/jquery/flot/jquery.js - About 2 wks to fix

    File export_import.php has 6416 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * @package     Arastta eCommerce
     * @copyright   2015-2017 Arastta Association. All rights reserved.
     * @copyright   See CREDITS.txt for credits and other copyright notices.
    Severity: Major
    Found in admin/model/tool/export_import.php - About 2 wks to fix

      File dejavusanscondensed.mtx.php has 4947 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      $name='DejaVuSansCondensed';
      $type='TTF';
      $desc=array (
        'CapHeight' => 729,
      Severity: Major
      Found in system/mpdf/ttfontdata/dejavusanscondensed.mtx.php - About 2 wks to fix

        File dejavusans.mtx.php has 4947 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        $name='DejaVuSans';
        $type='TTF';
        $desc=array (
          'CapHeight' => 729,
        Severity: Major
        Found in system/mpdf/ttfontdata/dejavusans.mtx.php - About 2 wks to fix

          Function print_graph has a Cognitive Complexity of 689 (exceeds 5 allowed). Consider refactoring.
          Open

          function print_graph($g,$pgwidth) {
              $splines = false;
              $bandw = false;
              $percent = false;
              $show_percent = false;
          Severity: Minor
          Found in system/mpdf/graph.php - About 2 wks 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 summernote.js has 4412 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /**
           * Super simple wysiwyg editor on Bootstrap v0.6.16
           * http://summernote.org/
           *
           * summernote.js
          Severity: Major
          Found in admin/view/javascript/summernote/summernote.js - About 1 wk to fix

            Function Gradient has a Cognitive Complexity of 576 (exceeds 5 allowed). Consider refactoring.
            Open

            function Gradient($x, $y, $w, $h, $type, $stops=array(), $colorspace='RGB', $coords='', $extend='', $return=false, $is_mask=false) {
                if (strtoupper(substr($type,0,1)) == 'L') { $type = 2; }    // linear
                else if (strtoupper(substr($type,0,1)) == 'R') { $type = 3; }    // radial
                if ($colorspace != 'CMYK' && $colorspace != 'Gray') {
                    $colorspace = 'RGB';
            Severity: Minor
            Found in system/mpdf/classes/grad.php - About 1 wk 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 Excel5.php has 3979 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * PHPExcel
             *
             * Copyright (c) 2006 - 2014 PHPExcel
            Severity: Major
            Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel5.php - About 1 wk to fix

              File bootstrap-editable.js has 3812 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*! X-editable - v1.5.1 
              * In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
              * http://github.com/vitalets/x-editable
              * Copyright (c) 2013 Vitaliy Potapov; Licensed MIT */
              /**
              Severity: Major
              Found in admin/view/javascript/bootstrap3-editable/js/bootstrap-editable.js - About 1 wk to fix

                Function ReadCSS has a Cognitive Complexity of 522 (exceeds 5 allowed). Consider refactoring.
                Open

                function ReadCSS($html) {
                    preg_match_all('/<style[^>]*media=["\']([^"\'>]*)["\'].*?<\/style>/is',$html,$m);
                    for($i=0; $i<count($m[0]); $i++) {
                        if ($this->mpdf->CSSselectMedia && !preg_match('/('.trim($this->mpdf->CSSselectMedia).'|all)/i',$m[1][$i])) { 
                            $html = preg_replace('/'.preg_quote($m[0][$i],'/').'/','',$html);
                Severity: Minor
                Found in system/mpdf/classes/cssmgr.php - About 1 wk 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 dejavusanscondensedB.mtx.php has 3666 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                $name='DejaVuSansCondensed-Bold';
                $type='TTF';
                $desc=array (
                  'CapHeight' => 729,
                Severity: Major
                Found in system/mpdf/ttfontdata/dejavusanscondensedB.mtx.php - About 1 wk to fix

                  Function index has a Cognitive Complexity of 505 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function index() {
                          $this->load->language('setting/setting');
                  
                          $this->document->setTitle($this->language->get('heading_title'));
                  
                  
                  Severity: Minor
                  Found in admin/controller/setting/setting.php - About 1 wk 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 MergeCSS has a Cognitive Complexity of 445 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function MergeCSS($inherit,$tag,$attr) {
                      $p = array();
                      $zp = array(); 
                  
                      $classes = array();
                  Severity: Minor
                  Found in system/mpdf/classes/cssmgr.php - About 1 wk 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 Calculation.php has 2991 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /**
                   * PHPExcel
                   *
                   * Copyright (c) 2006 - 2014 PHPExcel
                  Severity: Major
                  Found in system/PHPExcel/Classes/PHPExcel/Calculation.php - About 1 wk to fix

                    File pclzip.lib.php has 2947 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    // --------------------------------------------------------------------------------
                    // PhpConcept Library - Zip Module 2.8.2
                    // --------------------------------------------------------------------------------
                    // License GNU/LGPL - Vincent Blavet - August 2009
                    Severity: Major
                    Found in system/PHPExcel/Classes/PHPExcel/Shared/PCLZip/pclzip.lib.php - About 1 wk to fix

                      Function loadIntoExisting has a Cognitive Complexity of 367 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel)
                          {
                              $fromFormats    = array('\-',    '\ ');
                              $toFormats        = array('-',    ' ');
                      
                      
                      Severity: Minor
                      Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2003XML.php - About 1 wk 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 _writeCFRule has a Cognitive Complexity of 361 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private function _writeCFRule(PHPExcel_Style_Conditional $conditional){
                              $record      = 0x01B1;               // Record identifier
                      
                              // $type : Type of the CF
                              // $operatorType : Comparison operator
                      Severity: Minor
                      Found in system/PHPExcel/Classes/PHPExcel/Writer/Excel5/Worksheet.php - About 1 wk 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 parseMozGradient has a Cognitive Complexity of 357 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function parseMozGradient($bg) {
                         //    background[-image]: -moz-linear-gradient(left, #c7Fdde 20%, #FF0000 ); 
                         //    background[-image]: linear-gradient(left, #c7Fdde 20%, #FF0000 ); // CSS3
                         if (preg_match('/repeating-/',$bg)) { $repeat = true; }
                         else { $repeat = false; }
                      Severity: Minor
                      Found in system/mpdf/classes/grad.php - About 1 wk 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