mambax7/extgallery

View on GitHub

Showing 9,653 of 9,653 total issues

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

    toggleFullscreen: function( callback ) {
        this._fullscreen[ this.isFullscreen() ? 'exit' : 'enter'].apply( this, Utils.array( arguments ) );
        return this;
    },
Severity: Major
Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 1 hr to fix
assets/js/galleria/galleria-1.3.5.js on lines 4177..4180

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

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

    private function checkWpFooter()
    {
        $current_theme = wp_get_theme();
        $theme_name    = $current_theme->Template;

Severity: Minor
Found in assets/js/ml-slider/inc/metaslider.systemcheck.class.php - About 1 hr 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 convertorderbytrans has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function convertorderbytrans($SortbyOrderby)
{
    $orderbyTrans = [];
    if ('photo_date DESC' === $SortbyOrderby) {
        $orderbyTrans = _MD_EXTGALLERY_ORDERBY_DATEASC;
Severity: Minor
Found in public-album.php - About 1 hr 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 ajax_create_slide has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function ajax_create_slide()
    {
        // security check
        if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'metaslider_addslide')) {
            echo "<tr><td colspan='2'>" . __('Security check failed. Refresh page and try again.', 'metaslider') . '</td></tr>';
Severity: Minor
Found in assets/js/ml-slider/inc/slide/metaslide.image.class.php - About 1 hr 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 convertorderbytrans has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function convertorderbytrans($SortbyOrderby)
{
    $orderbyTrans = [];
    if ('photo_date DESC' === $SortbyOrderby) {
        $orderbyTrans = _MD_EXTGALLERY_ORDERBY_DATEASC;
Severity: Minor
Found in public-useralbum.php - About 1 hr 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 tmpdir has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function tmpdir()
    {
        if (OS_WINDOWS) {
            if ($var = $_ENV['TMP'] ?? getenv('TMP')) {
                return $var;
Severity: Minor
Found in class/pear/System.php - About 1 hr 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 getSum has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSum(\CriteriaElement $criteria = null, $sum = '*')
    {
        $field   = '';
        $groupby = false;
        if (\is_object($criteria) && \is_subclass_of($criteria, \CriteriaElement::class)) {
Severity: Minor
Found in class/PersistableObjectHandler.php - About 1 hr 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 _makeWatermark has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _makeWatermark($imageTransform)
    {
        if (!\function_exists('imagettfbbox')) {
            return;
        }
Severity: Minor
Found in class/PhotoHandler.php - About 1 hr 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 getMax has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getMax(\CriteriaElement $criteria = null, $max = '*')
    {
        $field   = '';
        $groupby = false;
        if (\is_object($criteria) && \is_subclass_of($criteria, \CriteriaElement::class)) {
Severity: Minor
Found in class/PersistableObjectHandler.php - About 1 hr 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 PclTraceAction has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    function PclTraceAction($p_entry)
    {
        global $g_pcl_trace_level;
        global $g_pcl_trace_mode;
        global $g_pcl_trace_filename;
Severity: Minor
Found in class/pcltrace.lib.php - About 1 hr 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 lazyLoadChunks has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    lazyLoadChunks: function( size, delay ) {

        var len = this.getDataLength(),
            i = 0,
            n = 0,
Severity: Minor
Found in assets/js/galleria/galleria-1.3.3.js - About 1 hr to fix

    Function lazyLoadChunks has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        lazyLoadChunks: function( size, delay ) {
    
            var len = this.getDataLength(),
                i = 0,
                n = 0,
    Severity: Minor
    Found in assets/js/galleria/galleria-1.3.5.js - About 1 hr to fix

      Function remove has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              remove: function(element, label, fn) {
                  var timers = jQuery.data(element, this.dataKey), ret;
      
                  if ( timers ) {
      
      
      Severity: Minor
      Found in assets/js/galleryview/timers.js - About 1 hr to fix

        Function animate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function animate( $element, properties, direct, callback, easing )
            {
                var duration = _duration;
        
                if ( $.isNumeric( direct ) )
        Severity: Minor
        Found in assets/js/TosRUs/src/js/jquery.tosrus.js - About 1 hr to fix

          Function _openClick has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _openClick: function(e, el, options) {
                  var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick;
          
          
                  if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey ) ) {
          Severity: Minor
          Found in assets/js/magnific_popup/jquery.magnific-popup.js - About 1 hr to fix

            Function parseEl has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                parseEl: function(index) {
                    var item = mfp.items[index],
                        type;
            
                    if(item.tagName) {
            Severity: Minor
            Found in assets/js/magnific_popup/jquery.magnific-popup.js - About 1 hr to fix

              Function cbResize has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  publicMethod.cbResize = function (options) {
                      var scrolltop;
              
                      if (open) {
                          options = options || {};
              Severity: Minor
              Found in assets/js/ml-slider/assets/colorbox/jquery.colorbox-min.js - About 1 hr to fix

                Method extgalleryTopSubmitterShow has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function extgalleryTopSubmitterShow($options)
                {
                    global $xoopsDB, $xoopsConfig;
                    $catauth = '';
                    $block   = [];
                Severity: Minor
                Found in blocks/extgallery_blocks.php - About 1 hr to fix

                  Method loadSampleData has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function loadSampleData()
                  {
                      global $xoopsConfig;
                      $moduleDirName      = \basename(\dirname(__DIR__));
                      $moduleDirNameUpper = mb_strtoupper($moduleDirName);
                  Severity: Minor
                  Found in testdata/index.php - About 1 hr to fix

                    Method getList has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getList(CriteriaElement $criteria = null, $limit = 0, $start = 0)
                        {
                            $ret = [];
                            if (null === $criteria) {
                                $criteria = new CriteriaCompo();
                    Severity: Minor
                    Found in class/ModelReadIterator.php - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language