CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Function akismet_caught has a Cognitive Complexity of 150 (exceeds 5 allowed). Consider refactoring.
Open

function akismet_caught() {
    global $wpdb, $comment, $akismet_caught, $akismet_nonce;

    akismet_recheck_queue();
    if (isset($_POST['submit']) && 'recover' == $_POST['action'] && ! empty($_POST['not_spam'])) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-content/plugins/akismet/akismet.php - About 3 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

File admin-ajax.php has 1184 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * WordPress AJAX Process Execution.
 *
 * @package WordPress
Severity: Major
Found in Web.Admin/2014/wordpress/wp-admin/admin-ajax.php - About 3 days to fix

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

    function dw_getRandomImage(rObj, bReturn) {
        var imgAr = rObj.images;  if (!imgAr ) return '';
        var num = Math.floor( Math.random() * imgAr.length );
        var imgStr = '';   var imgFile = imgAr[ num ];
        rObj.num = num; // hold which img selected (for ctr)
    Severity: Major
    Found in Web.Admin/2015/js/dw_rotator_aux.js and 1 other location - About 3 days to fix
    Web.Admin/2014/js/dw_rotator_aux.js on lines 16..54

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

    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

    function dw_getRandomImage(rObj, bReturn) {
        var imgAr = rObj.images;  if (!imgAr ) return '';
        var num = Math.floor( Math.random() * imgAr.length );
        var imgStr = '';   var imgFile = imgAr[ num ];
        rObj.num = num; // hold which img selected (for ctr)
    Severity: Major
    Found in Web.Admin/2014/js/dw_rotator_aux.js and 1 other location - About 3 days to fix
    Web.Admin/2015/js/dw_rotator_aux.js on lines 16..54

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

    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 customize-widgets.js has 1163 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* global _wpCustomizeWidgetsSettings */
    (function( wp, $ ){
    
        if ( ! wp || ! wp.customize ) { return; }
    
    
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-admin/js/customize-widgets.js - About 2 days to fix

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

          public function date_rfc2822($date)
          {
              static $pcre;
              if (!$pcre)
              {
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Parse/Date.php and 1 other location - About 2 days to fix
      Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 13244..13329

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

      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 date_rfc2822($date)
          {
              static $pcre;
              if (!$pcre)
              {
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php and 1 other location - About 2 days to fix
      Web.Admin/2014/wordpress/wp-includes/SimplePie/Parse/Date.php on lines 770..855

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

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

      <?php
      /**
       * Taxonomy API
       *
       * @package WordPress
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/taxonomy.php - About 2 days to fix

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

            public function get_categories()
            {
                $categories = array();
        
                foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'category') as $category)
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php and 1 other location - About 2 days to fix
        Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php on lines 153..208

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

        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

            public function get_categories()
            {
                $categories = array();
        
                foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'category') as $category)
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.php and 1 other location - About 2 days to fix
        Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php on lines 438..493

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

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

        <?php
        /*~ class.phpmailer.php
        .---------------------------------------------------------------------------.
        |  Software: PHPMailer - PHP email class                                    |
        |   Version: 2.0.4                                                          |
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/class-phpmailer.php - About 2 days to fix

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

          Form.Element.Methods = {
            serialize: function(element) {
              element = $(element);
              if (!element.disabled && element.name) {
                var value = element.getValue();
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/js/prototype.js and 1 other location - About 2 days to fix
          Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/prototype.js on lines 3468..3527

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

          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

          Form.Element.Methods = {
            serialize: function(element) {
              element = $(element);
              if (!element.disabled && element.name) {
                var value = element.getValue();
          Web.Admin/2014/wordpress/wp-includes/js/prototype.js on lines 3468..3527

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

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

          function dbDelta($queries, $execute = true) {
              global $wpdb;
          
              // Separate individual queries into an array
              if( !is_array($queries) ) {
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-admin/includes/upgrade.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

          Function __construct has a Cognitive Complexity of 140 (exceeds 5 allowed). Consider refactoring.
          Open

              public function __construct($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false)
              {
                  if (class_exists('idna_convert'))
                  {
                      $idn = new idna_convert();
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/File.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

          if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){
            function iter(name) {
              return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
            }
          
          
          Web.Admin/2014/wordpress/wp-includes/js/prototype.js on lines 4114..4145

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

          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

          if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){
            function iter(name) {
              return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
            }
          
          
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/js/prototype.js and 1 other location - About 2 days to fix
          Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/prototype.js on lines 4114..4145

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

          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

          {var x1=a[0]/xscale,y1=a[1]/yscale,x2=a[2]/xscale,y2=a[3]/yscale;if(animating)return;var animto=Coords.flipCoords(x1,y1,x2,y2);var c=Coords.getFixed();var animat=initcr=[c.x,c.y,c.x2,c.y2];var interv=options.animationDelay;var x=animat[0];var y=animat[1];var x2=animat[2];var y2=animat[3];var ix1=animto[0]-initcr[0];var iy1=animto[1]-initcr[1];var ix2=animto[2]-initcr[2];var iy2=animto[3]-initcr[3];var pcent=0;var velocity=options.swingSpeed;Selection.animMode(true);var animator=function()
          {return function()
          {pcent+=(100-pcent)/velocity;animat[0]=x+((pcent/100)*ix1);animat[1]=y+((pcent/100)*iy1);animat[2]=x2+((pcent/100)*ix2);animat[3]=y2+((pcent/100)*iy2);if(pcent<100)animateStart();else Selection.done();if(pcent>=99.8)pcent=100;setSelectRaw(animat);};}();function animateStart()
          {window.setTimeout(animator,interv);};animateStart();};function setSelect(rect)
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/js/jcrop/jquery.Jcrop.js and 1 other location - About 2 days to fix
          Web.Admin/2014/wordpress/wp-includes/js/jcrop/jquery.Jcrop.dev.js on lines 976..1026

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

          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

              {
                  var x1 = a[0] / xscale,
                      y1 = a[1] / yscale,
                      x2 = a[2] / xscale,
                      y2 = a[3] / yscale;
          Web.Admin/2014/wordpress/wp-includes/js/jcrop/jquery.Jcrop.js on lines 138..141

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

          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

              function add( $args = '' ) {
                  $defaults = array(
                      'what' => 'object', 'action' => false,
                      'id' => '0', 'old_id' => false,
                      'position' => 1,
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/classes.php and 1 other location - About 2 days to fix
          Web.Admin/2014/wordpress/wp-includes/class-wp-ajax-response.php on lines 55..119

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

          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