CaffGeek/MBACNationals

View on GitHub

Showing 5,566 of 7,504 total issues

Function diff has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    function diff($from_lines, $to_lines)
    {
        array_walk($from_lines, array('Text_Diff', 'trimNewlines'));
        array_walk($to_lines, array('Text_Diff', 'trimNewlines'));

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/Text/Diff/Engine/shell.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 16 (exceeds 5 allowed). Consider refactoring.
Open

    function compatible_gzinflate($gzData) {
        if ( substr($gzData, 0, 3) == "\x1f\x8b\x08" ) {
            $i = 10;
            $flg = ord( substr($gzData, 3, 1) );
            if ( $flg > 0 ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/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 multi_resize has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function multi_resize( $sizes ) {
        $metadata = array();
        $orig_size = $this->size;

        foreach ( $sizes as $size => $size_data ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-image-editor-gd.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 find has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    function find($type = SIMPLEPIE_LOCATOR_ALL, &$working)
    {
        if ($this->is_feed($this->file))
        {
            return $this->file;
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 date_rfc2822 has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    function date_rfc2822($date)
    {
        static $pcre;
        if (!$pcre)
        {
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 get_date has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    function get_date($date_format = 'j F Y, g:i a')
    {
        if (!isset($this->data['date']))
        {
            if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'published'))
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 comments_template has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function comments_template( $file = '/comments.php', $separate_comments = false ) {
    global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity, $overridden_cpage;

    if ( !(is_single() || is_page() || $withcomments) || empty($post) )
        return;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/comment-template.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 scandir has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    private static function scandir( $path, $extensions = null, $depth = 0, $relative_path = '' ) {
        if ( ! is_dir( $path ) )
            return false;

        if ( $extensions ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-theme.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 comments_popup_link has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function comments_popup_link( $zero = false, $one = false, $more = false, $css_class = '', $none = false ) {
    global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post;

    if ( false === $zero ) $zero = __( 'No Comments' );
    if ( false === $one ) $one = __( '1 Comment' );
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/comment-template.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 wp_unique_filename has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function wp_unique_filename( $dir, $filename, $unique_filename_callback = null ) {
    // sanitize the file name before we begin processing
    $filename = sanitize_file_name($filename);

    // separate the filename into a name and extension
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/functions.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 load has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Galleria.prototype.load = function() {

    // pass if no data is provided or picasa option not found
    if ( arguments.length || typeof this._options.picasa !== 'string' ) {
        load.apply( this, Galleria.utils.array( arguments ) );
Severity: Major
Found in Web.Admin/2015/js/galleria/plugins/picasa/galleria.picasa.js - About 2 hrs to fix

    Function init has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        init: function(options) {
    
            Galleria.requires(1.4, 'This version of Classic theme requires Galleria 1.4 or later');
    
            // add some elements
    Severity: Major
    Found in Web.Admin/2015/js/galleria/themes/classic/galleria.classic.js - About 2 hrs to fix

      Function docKeyPress has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var docKeyPress = function(event) {
              var k = options.keys, d, t, key = event.keyCode || event.which;
      
              d = !isNaN(k.alt) && (event.altKey || event.originalEvent.altKey) ? k.alt :
                  !isNaN(k.ctrl) && event.ctrlKey ? k.ctrl :

        Function props has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                props: function( props, attachment ) {
                    var link, linkUrl, size, sizes, fallbacks,
                        defaultProps = wp.media.view.settings.defaultProps;
        
                    // Final fallbacks run after all processing has been completed.
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/js/media-editor.js - About 2 hrs to fix

          Function initialize has 52 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            initialize: function(handle, track, options) {
              var slider = this;
              
              if (Object.isArray(handle)) {
                this.handles = handle.collect( function(e) { return $(e) });
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/slider.js - About 2 hrs to fix

            Function load has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Galleria.prototype.load = function() {
            
                // pass if no data is provided or picasa option not found
                if ( arguments.length || typeof this._options.picasa !== 'string' ) {
                    load.apply( this, Galleria.utils.array( arguments ) );
            Severity: Major
            Found in Web.Admin/Content/galleria/plugins/picasa/galleria.picasa.js - About 2 hrs to fix

              Method privExtractFileAsString has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function privExtractFileAsString(&$p_entry, &$p_string, &$p_options)
                {
                  $v_result=1;
              
                  // ----- Read the file header
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-admin/includes/class-pclzip.php - About 2 hrs to fix

                Function init has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    init: function(options) {
                
                        Galleria.requires(1.4, 'This version of Classic theme requires Galleria 1.4 or later');
                
                        // add some elements
                Severity: Major
                Found in Web.Admin/Content/galleria/themes/classic/galleria.classic.js - About 2 hrs to fix

                  Method save_post has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function save_post(&$post, &$comments, &$pings) {
                          // Reset the counter
                          set_time_limit(30);
                          $post = get_object_vars($post);
                          $post = add_magic_quotes($post);
                  Severity: Major
                  Found in Web.Admin/2014/wordpress/wp-admin/import/mt.php - About 2 hrs to fix

                    Method get_admin_page_parent has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function get_admin_page_parent( $parent = '' ) {
                        global $parent_file;
                        global $menu;
                        global $submenu;
                        global $pagenow;
                    Severity: Major
                    Found in Web.Admin/2014/wordpress/wp-admin/includes/plugin.php - About 2 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language