CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Method map_meta_cap has 152 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function map_meta_cap( $cap, $user_id ) {
    $args = array_slice( func_get_args(), 2 );
    $caps = array();

    switch ( $cap ) {
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/capabilities.php - About 6 hrs to fix

    File capabilities.php has 419 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * WordPress Roles and Capabilities.
     *
     * @package WordPress
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/capabilities.php - About 6 hrs to fix

      Function createHttpBackendMock has 151 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
        var definitions = [],
            expectations = [],
            responses = [],
            responsesPush = angular.bind(responses, responses.push),
      Severity: Major
      Found in Web.Admin/z-scripts/angular-mocks.js - About 6 hrs to fix

        File Sanitize.php has 418 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /**
         * SimplePie
         *
         * A PHP-Based RSS and Atom Feed Framework.
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Sanitize.php - About 6 hrs to fix

          Function ajaxSubmit has 150 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          $.fn.ajaxSubmit = function(options) {
              if (typeof options == 'function')
                  options = { success: options };
          
              options = $.extend({
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/js/jquery/jquery.form.dev.js - About 6 hrs to fix

            Akismet_Admin has 44 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Akismet_Admin {
                const NONCE = 'akismet-update-key';
            
                private static $initiated = false;
                private static $notices = array();

              Consider simplifying this complex logical expression.
              Open

                      if ( is_attachment() && !empty($_GET['attachment_id']) && ! $redirect_url ) {
                          if ( $redirect_url = get_attachment_link(get_query_var('attachment_id')) )
                              $redirect['query'] = remove_query_arg('attachment_id', $redirect['query']);
                      } elseif ( is_single() && !empty($_GET['p']) && ! $redirect_url ) {
                          if ( $redirect_url = get_permalink(get_query_var('p')) )
              Severity: Critical
              Found in Web.Admin/2014/wordpress/wp-includes/canonical.php - About 6 hrs to fix

                Method QuicktimeParseNikonNCTG has 150 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function QuicktimeParseNikonNCTG($atom_data) {
                        // http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html#NCTG
                        // Nikon-specific QuickTime tags found in the NCDT atom of MOV videos from some Nikon cameras such as the Coolpix S8000 and D5100
                        // Data is stored as records of:
                        // * 4 bytes record type

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

                      shortcuts : function() {
                          var cCode = arguments[0];
                          if(cCode==13) cCode = '[enter]';
                          else if(cCode==32) cCode = '[space]';
                          else cCode = '['+String.fromCharCode(charCode).toLowerCase()+']';
                  Web.Admin/2014/wordpress/wp-includes/js/codepress/engines/msie.js on lines 204..212
                  Web.Admin/2014/wordpress/wp-includes/js/codepress/engines/opera.js on lines 172..180

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

                  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

                      shortcuts : function() {
                          var cCode = arguments[0];
                          if(cCode==13) cCode = '[enter]';
                          else if(cCode==32) cCode = '[space]';
                          else cCode = '['+String.fromCharCode(charCode).toLowerCase()+']';
                  Web.Admin/2014/wordpress/wp-includes/js/codepress/engines/gecko.js on lines 197..205
                  Web.Admin/2014/wordpress/wp-includes/js/codepress/engines/msie.js on lines 204..212

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

                  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

                      shortcuts : function() {
                          var cCode = arguments[0];
                          if(cCode==13) cCode = '[enter]';
                          else if(cCode==32) cCode = '[space]';
                          else cCode = '['+String.fromCharCode(keyCode).toLowerCase()+']';
                  Web.Admin/2014/wordpress/wp-includes/js/codepress/engines/gecko.js on lines 197..205
                  Web.Admin/2014/wordpress/wp-includes/js/codepress/engines/opera.js on lines 172..180

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

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

                  function $UrlRouterProvider(   $locationProvider,   $urlMatcherFactory) {
                    var rules = [], otherwise = null, interceptDeferred = false, listener;
                  
                    // Returns a string that is a prefix of all strings matching the RegExp
                    function regExpPrefix(re) {
                  Severity: Major
                  Found in Web.Admin/z-scripts/angular-ui-router.js - About 5 hrs to fix

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

                    (function($){$.Jcrop=function(obj,opt)
                    {var obj=obj,opt=opt;if(typeof(obj)!=='object')obj=$(obj)[0];if(typeof(opt)!=='object')opt={};if(!('trackDocument'in opt))
                    {opt.trackDocument=$.browser.msie?false:true;if($.browser.msie&&$.browser.version.split('.')[0]=='8')
                    opt.trackDocument=true;}
                    if(!('keySupport'in opt))
                    Severity: Major
                    Found in Web.Admin/2014/wordpress/wp-includes/js/jcrop/jquery.Jcrop.js - About 5 hrs to fix

                      Function node has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                      Open

                        node: function(elementName) {
                          elementName = elementName.toUpperCase();
                          
                          // try innerHTML approach
                          var parentTag = this.NODEMAP[elementName] || 'div';
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/builder.js - About 5 hrs 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 extractByIndex has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                      Open

                        function extractByIndex($p_index)
                        {
                          $v_result=1;
                      
                          // ----- Reset the error handler
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-admin/includes/class-pclzip.php - About 5 hrs 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 prepare_items has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                      Open

                          function prepare_items() {
                              global $status, $plugins, $totals, $page, $orderby, $order, $s;
                      
                              wp_reset_vars( array( 'orderby', 'order', 's' ) );
                      
                      

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

                          function show_blogs($iter = 0) {
                              if ( empty($this->blogs) ) {
                                  $headers = array(
                                      "GET /feeds/default/blogs HTTP/1.0",
                                      "Host: www.blogger.com",
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-admin/import/blogger.php - About 5 hrs 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 strip_tag has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function strip_tag($tag, $document, $type)
                          {
                              $xpath = new DOMXPath($document);
                              $elements = $xpath->query('body//' . $tag);
                              if ($this->encode_instead_of_strip)
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Sanitize.php - About 5 hrs 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 wp-login.php has 412 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /**
                       * WordPress User Page
                       *
                       * Handles authentication, registering, resetting passwords, forgot password,
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-login.php - About 5 hrs to fix

                        Method widget has 147 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function widget( $args, $instance ) {
                                $format = $instance['format'];
                        
                                switch ( $format ) {
                                    case 'image':
                          Severity
                          Category
                          Status
                          Source
                          Language