CaffGeek/MBACNationals

View on GitHub

Showing 5,566 of 7,504 total issues

Function wp_user_settings has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function wp_user_settings() {

    if ( ! is_admin() )
        return;

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/functions.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 get_usermeta has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function get_usermeta( $user_id, $meta_key = '') {
    global $wpdb;
    $user_id = (int) $user_id;

    if ( !$user_id )
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/user.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 wp_dropdown_users has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function wp_dropdown_users( $args = '' ) {
    global $wpdb;
    $defaults = array(
        'show_option_all' => '', 'show_option_none' => '',
        'orderby' => 'display_name', 'order' => 'ASC',
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/user.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 _wp_specialchars has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) {
    $string = (string) $string;

    if ( 0 === strlen( $string ) ) {
        return '';
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/formatting.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 get_boundary_post has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function get_boundary_post($in_same_cat = false, $excluded_categories = '', $start = true) {
    global $post, $wpdb;

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

    function send_through_proxy( $uri ) {
        // parse_url() only handles http, https type URLs, and will emit E_WARNING on failure.
        // This will be displayed on blogs, which is not reasonable.
        $check = @parse_url($uri);

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-http.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

Method Handle has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring.
Open

        public IEnumerable Handle(Func<Guid, ParticipantAggregate> al, UpdateParticipant command)
        {
            var agg = al(command.Id);

            if (agg.Name != command.Name)
Severity: Minor
Found in Aggregates/Participant/ParticipantCommandHandlers.cs - 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 make_thumb has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function make_thumb($folder,$file,$dest,$thumb_width) {

    $ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));
    
    switch($ext)
Severity: Minor
Found in Web.Admin/2014/foliogallery.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 get_attachment_link has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function get_attachment_link($id = false) {
    global $post, $wp_rewrite;

    $link = false;

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/link-template.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 $interval has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var $interval = function(fn, delay, count, invokeApply) {
      var hasParams = arguments.length > 4,
          args = hasParams ? Array.prototype.slice.call(arguments, 4) : [],
          iteration = 0,
          skipApply = (angular.isDefined(invokeApply) && !invokeApply),
Severity: Minor
Found in Web.Admin/z-scripts/angular-mocks.js - About 1 hr to fix

    Function format has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    UrlMatcher.prototype.format = function (values) {
      values = values || {};
      var segments = this.segments, params = this.parameters(), paramset = this.params;
      if (!this.validates(values)) return null;
    
    
    Severity: Minor
    Found in Web.Admin/z-scripts/angular-ui-router.js - About 1 hr to fix

      Function bind has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              bind: function( elem, value ) {
      
                  // todo: revise if alternative tooltip is needed for mobile devices
                  if (Galleria.TOUCH) {
                      return;
      Severity: Minor
      Found in Web.Admin/2015/js/galleria/galleria-1.4.2.js - About 1 hr to fix

        Function raise has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Galleria.raise = function( msg, fatal ) {
        
            var type = fatal ? 'Fatal error' : 'Error',
        
                css = {
        Severity: Minor
        Found in Web.Admin/2015/js/galleria/galleria-1.4.2.js - About 1 hr to fix

          Function attachments has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      attachments: function( shortcode ) {
                          var shortcodeString = shortcode.string(),
                              result = collections[ shortcodeString ],
                              attrs, args, query, others, self = this;
          
          
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-includes/js/media-editor.js - About 1 hr to fix

            Function update has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function update(resetKeyPress) {
                    if (!shown) return;
            
                    $box.css({ left: viewX(selection.x1), top: viewY(selection.y1) })
                        .add($area).width(w = selection.width).height(h = selection.height);

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

                      initialize: function( id, options ) {
                          var control = this,
                              nodes, radios, settings;
              
                          this.params = {};
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-admin/js/customize-controls.js - About 1 hr to fix

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

                function init() {
                    var ed, tcont;
                
                    tinyMCEPopup.resizeToInnerSize();
                    ed = tinyMCEPopup.editor;

                  Function baseInitialize has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    baseInitialize: function(element, update, options) {
                      element          = $(element)
                      this.element     = element; 
                      this.update      = $(update);  
                      this.hasFocus    = false; 
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/controls.js - About 1 hr to fix

                    Function bind has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            bind: function( elem, value ) {
                    
                                // todo: revise if alternative tooltip is needed for mobile devices
                                if (Galleria.TOUCH) {
                                    return;
                    Severity: Minor
                    Found in Web.Admin/Content/galleria/galleria-1.4.2.js - About 1 hr to fix

                      Function raise has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      Galleria.raise = function( msg, fatal ) {
                      
                          var type = fatal ? 'Fatal error' : 'Error',
                      
                              css = {
                      Severity: Minor
                      Found in Web.Admin/Content/galleria/galleria-1.4.2.js - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language