CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Function array_unique has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    function array_unique($array)
    {
        if (version_compare(PHP_VERSION, '5.2', '>='))
        {
            return array_unique($array);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 2 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 compatible_gzinflate has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public static function compatible_gzinflate($gzData) {

        // Compressed data might contain a full header, if so strip it for gzinflate()
        if ( substr($gzData, 0, 3) == "\x1f\x8b\x08" ) {
            $i = 10;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-http.php - About 2 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 CreateBody has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

  function CreateBody() {
    $result = '';
    if ($this->sign_key_file) {
      $result .= $this->GetMailMIME();
    }
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-phpmailer.php - About 2 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 transform has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    Image.transform = function (file, transform, autoOrientation, fn){
        function _transform(err, img){
            // img -- info object
            var
                  images = {}
Severity: Major
Found in Web.Admin/z-scripts/FileAPI.js - About 2 hrs to fix

    Function _ExceptionDetails has 60 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                var _ExceptionDetails = (function (_super) {
                    __extends(_ExceptionDetails, _super);
                    function _ExceptionDetails(exception) {
                        _super.call(this);
                        this.aiDataContract = {
    Severity: Major
    Found in Web.Admin/z-scripts/ai.0.15.0-build46802.js - About 2 hrs to fix

      Function hotelController has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var hotelController = function ($http, $q, $location, dataService) {
              var url = $location.absUrl();
              var lastSlash = url.lastIndexOf('/');
              var year = url.slice(lastSlash + 1);
      
      Severity: Major
      Found in Web.Admin/AdminApp/Controllers/controller.hotel.js - About 2 hrs to fix

        Function renderIframeUI has 60 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function renderIframeUI(args) {
                var panel, resizeHandleCtrl, startSize;
        
                if (args.skinUiCss) {
                    tinymce.DOM.loadCSS(args.skinUiCss);

          Function filterStyles has 60 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      function filterStyles(node, styleValue) {
                          var outputStyles = {}, styles = editor.dom.parseStyle(styleValue);
          
                          // Parse out list indent level for lists
                          if (node.name === 'p') {

            Function edInsertTag has 60 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function edInsertTag(myField, i) {
                //IE support
                if (document.selection) {
                    myField.focus();
                    var sel = document.selection.createRange();
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/js/quicktags.dev.js - About 2 hrs to fix

              Method wp_write_post has 60 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function wp_write_post() {
                  global $user_ID;
              
                  if ( 'page' == $_POST['post_type'] ) {
                      if ( !current_user_can( 'edit_pages' ) )
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-admin/includes/post.php - About 2 hrs to fix

                Method prepare_items has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  Method user_can_access_admin_page has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function user_can_access_admin_page() {
                      global $pagenow;
                      global $menu;
                      global $submenu;
                      global $_wp_menu_nopriv;
                  Severity: Major
                  Found in Web.Admin/2014/wordpress/wp-admin/includes/plugin.php - About 2 hrs to fix

                    Method kubrick_add_theme_page has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function kubrick_add_theme_page() {
                        if ( isset( $_GET['page'] ) && $_GET['page'] == basename(__FILE__) ) {
                            if ( isset( $_REQUEST['action'] ) && 'save' == $_REQUEST['action'] ) {
                                check_admin_referer('kubrick-header');
                                if ( isset($_REQUEST['njform']) ) {
                    Severity: Major
                    Found in Web.Admin/2014/wordpress/wp-content/themes/default/functions.php - About 2 hrs to fix

                      Method kubrick_theme_page has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function kubrick_theme_page() {
                          if ( isset( $_REQUEST['saved'] ) ) echo '<div id="message" class="updated fade"><p><strong>'.__('Options saved.').'</strong></p></div>';
                      ?>
                      <div class='wrap'>
                          <h2><?php _e('Customize Header'); ?></h2>
                      Severity: Major
                      Found in Web.Admin/2014/wordpress/wp-content/themes/default/functions.php - About 2 hrs to fix

                        Method wp_delete_attachment has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function wp_delete_attachment( $post_id, $force_delete = false ) {
                            global $wpdb;
                        
                            if ( !$post = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->posts WHERE ID = %d", $post_id) ) )
                                return $post;
                        Severity: Major
                        Found in Web.Admin/2014/wordpress/wp-includes/post.php - About 2 hrs to fix

                          Method wp_explain_nonce has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function wp_explain_nonce( $action ) {
                              if ( $action !== -1 && preg_match( '/([a-z]+)-([a-z]+)(_(.+))?/', $action, $matches ) ) {
                                  $verb = $matches[1];
                                  $noun = $matches[2];
                          
                          
                          Severity: Major
                          Found in Web.Admin/2014/wordpress/wp-includes/functions.php - About 2 hrs to fix

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

                                        ed.dom.setAttribs(e, {
                                            href : f.href.value,
                                            title : f.linktitle.value,
                                            target : f.target_list ? getSelectValue(f, "target_list") : null,
                                            'class' : f.class_list ? getSelectValue(f, "class_list") : null
                            Web.Admin/2014/wordpress/wp-includes/js/tinymce/themes/advanced/js/link.js on lines 63..68

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

                            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

                                                ed.dom.setAttribs(e, {
                                                    href : f.href.value,
                                                    title : f.linktitle.value,
                                                    target : f.target_list ? getSelectValue(f, "target_list") : null,
                                                    'class' : f.class_list ? getSelectValue(f, "class_list") : null
                            Web.Admin/2014/wordpress/wp-includes/js/tinymce/themes/advanced/js/link.js on lines 72..77

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

                            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

                                        TelemetryContext.prototype._applySampleContext = function (envelope, sampleContext) {
                                            if (sampleContext) {
                                                var tagKeys = new AI.ContextTagKeys();
                                                if (typeof sampleContext.sampleRate === "string") {
                                                    envelope.tags[tagKeys.sampleRate] = sampleContext.sampleRate;
                            Severity: Major
                            Found in Web.Admin/z-scripts/ai.0.15.0-build46802.js and 1 other location - About 2 hrs to fix
                            Web.Admin/z-scripts/ai.0.15.0-build46802.js on lines 1896..1903

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

                            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

                                        ed.addCommand('JustifyRight', function() {
                                            var n = ed.selection.getNode();
                            
                                            if ( n.nodeName != 'IMG' )
                                                ed.editorCommands.mceJustify('JustifyRight', 'right');
                            Web.Admin/2014/wordpress/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.dev.js on lines 138..144

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

                            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