arastta/arastta

View on GitHub

Showing 7,509 of 7,509 total issues

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

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

      if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object') {
          elFinder.prototype.i18.no = {
              translator : 'Stian Jacobsen &lt;stian@promonorge.no&gt;',
              language   : 'Norwegian Bokmål',
              direction  : 'ltr',
      Severity: Major
      Found in admin/view/javascript/elfinder/i18n/elfinder.no.js and 2 other locations - About 1 wk to fix
      admin/view/javascript/elfinder/i18n/elfinder.br.js on lines 6..280
      admin/view/javascript/elfinder/i18n/elfinder.zh.js on lines 6..280

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

      if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object') {
          elFinder.prototype.i18.zh_CN = {
              translator : '翻译者 &lt;deerchao@gmail.com&gt;',
              language   : '简体中文',
              direction  : 'ltr',
      Severity: Major
      Found in admin/view/javascript/elfinder/i18n/elfinder.zh.js and 2 other locations - About 1 wk to fix
      admin/view/javascript/elfinder/i18n/elfinder.br.js on lines 6..280
      admin/view/javascript/elfinder/i18n/elfinder.no.js on lines 6..280

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

      if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object') {
          elFinder.prototype.i18.pt_BR = {
              translator : 'Leandro Carvalho &lt;contato@leandrowebdev.net&gt;',
              language   : 'Português',
              direction  : 'ltr',
      Severity: Major
      Found in admin/view/javascript/elfinder/i18n/elfinder.br.js and 2 other locations - About 1 wk to fix
      admin/view/javascript/elfinder/i18n/elfinder.no.js on lines 6..280
      admin/view/javascript/elfinder/i18n/elfinder.zh.js on lines 6..280

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

      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 ($) {
        'use strict';
      
        // DROPDOWN CLASS DEFINITION
        // =========================
      Severity: Major
      Found in admin/view/javascript/bootstrap/js/bootstrap.js and 1 other location - About 1 wk to fix
      catalog/view/javascript/bootstrap/js/bootstrap.js on lines 750..901

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

      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 ($) {
        'use strict';
      
        // DROPDOWN CLASS DEFINITION
        // =========================
      Severity: Major
      Found in catalog/view/javascript/bootstrap/js/bootstrap.js and 1 other location - About 1 wk to fix
      admin/view/javascript/bootstrap/js/bootstrap.js on lines 752..903

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

      <?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/controller/payment/cod.php and 2 other locations - About 1 wk to fix
      admin/controller/shipping/flat.php on lines 1..138
      admin/controller/shipping/item.php on lines 1..138

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

      <?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/controller/shipping/item.php and 2 other locations - About 1 wk to fix
      admin/controller/payment/cod.php on lines 1..139
      admin/controller/shipping/flat.php on lines 1..138

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

      <?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/controller/shipping/flat.php and 2 other locations - About 1 wk to fix
      admin/controller/payment/cod.php on lines 1..139
      admin/controller/shipping/item.php on lines 1..138

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

      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

      <?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/controller/total/low_order_fee.php and 1 other location - About 1 wk to fix
      admin/controller/total/handling.php on lines 1..135

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

      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

      <?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/controller/total/handling.php and 1 other location - About 1 wk to fix
      admin/controller/total/low_order_fee.php on lines 1..135

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

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

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

              if (!isset($this->session->data['api_id'])) {
                  $json['error']['warning'] = $this->language->get('error_permission');
              } else {
                  // Add keys for missing post vars
                  $keys = array(
      Severity: Major
      Found in catalog/controller/api/payment.php and 1 other location - About 1 wk to fix
      catalog/controller/api/shipping.php on lines 22..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 1267.

      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($this->session->data['api_id'])) {
                      $json['error']['warning'] = $this->language->get('error_permission');
                  } else {
                      // Add keys for missing post vars
                      $keys = array(
      Severity: Major
      Found in catalog/controller/api/shipping.php and 1 other location - About 1 wk to fix
      catalog/controller/api/payment.php on lines 21..139

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

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

          public function index() {
              $this->load->language('setting/setting');
      
              $this->document->setTitle($this->language->get('heading_title'));
      
      
      Severity: Major
      Found in admin/controller/setting/setting.php - About 6 days to fix

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

            function utf8_strtolower($string) {
                static $upper_to_lower;
        
                if ($upper_to_lower == null) {
                    $upper_to_lower = array(
        Severity: Major
        Found in system/helper/utf8.php and 1 other location - About 6 days to fix
        system/helper/utf8.php on lines 297..531

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

        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 utf8_strtoupper($string) {
                static $lower_to_upper;
        
                if ($lower_to_upper == null) {
                    $lower_to_upper = array(
        Severity: Major
        Found in system/helper/utf8.php and 1 other location - About 6 days to fix
        system/helper/utf8.php on lines 61..295

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

        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