CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

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

function get_site_option( $option, $default = false, $use_cache = true ) {
    global $wpdb;

    /**
     * Filter an existing site option before it is retrieved.
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/option.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 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

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

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

        elseif (substr($data, 0, 10) === "\x3C\x00\x3F\x00\x78\x00\x6D\x00\x6C\x00")
        {
            if ($pos = strpos($data, "\x3F\x00\x3E\x00"))
            {
                $parser =& new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16LE', 'UTF-8'));
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php and 3 other locations - About 1 hr to fix
Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 11254..11265
Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 11267..11278
Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 11280..11291

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

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 4 locations. Consider refactoring.
Open

        elseif (substr($data, 0, 20) === "\x3C\x00\x00\x00\x3F\x00\x00\x00\x78\x00\x00\x00\x6D\x00\x00\x00\x6C\x00\x00\x00")
        {
            if ($pos = strpos($data, "\x3F\x00\x00\x00\x3E\x00\x00\x00"))
            {
                $parser =& new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32LE', 'UTF-8'));
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php and 3 other locations - About 1 hr to fix
Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 11254..11265
Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 11280..11291
Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 11293..11304

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

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 ( !is_singular() ) {
                $title = get_the_title($comment_post->ID);
                $title = apply_filters('the_title_rss', $title);
                printf(ent2ncr(__('Comment on %1$s by %2$s')), $title, get_comment_author_rss());
            } else {
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/feed-atom-comments.php and 1 other location - About 1 hr to fix
Web.Admin/2014/wordpress/wp-includes/feed-rss2-comments.php on lines 43..49

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

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 4 locations. Consider refactoring.
Open

        elseif (substr($data, 0, 10) === "\x00\x3C\x00\x3F\x00\x78\x00\x6D\x00\x6C")
        {
            if ($pos = strpos($data, "\x00\x3F\x00\x3E"))
            {
                $parser =& new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16BE', 'UTF-8'));
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php and 3 other locations - About 1 hr to fix
Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 11254..11265
Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 11267..11278
Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 11293..11304

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

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

            elseif ($restrictions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'block'))
            {
                foreach ($restrictions as $restriction)
                {
                    $restriction_relationship = 'allow';
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php and 1 other location - About 1 hr to fix
Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 4301..4314

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

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 4 locations. Consider refactoring.
Open

        elseif (substr($data, 0, 20) === "\x00\x00\x00\x3C\x00\x00\x00\x3F\x00\x00\x00\x78\x00\x00\x00\x6D\x00\x00\x00\x6C")
        {
            if ($pos = strpos($data, "\x00\x00\x00\x3F\x00\x00\x00\x3E"))
            {
                $parser =& new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32BE', 'UTF-8'));
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php and 3 other locations - About 1 hr to fix
Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 11267..11278
Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 11280..11291
Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 11293..11304

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

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 ( !is_singular() ) {
                $title = get_the_title($comment_post->ID);
                $title = apply_filters('the_title_rss', $title);
                printf(ent2ncr(__('Comment on %1$s by %2$s')), $title, get_comment_author_rss());
            } else {
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/feed-rss2-comments.php and 1 other location - About 1 hr to fix
Web.Admin/2014/wordpress/wp-includes/feed-atom-comments.php on lines 51..57

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

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

            elseif ($restrictions = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'block'))
            {
                foreach ($restrictions as $restriction)
                {
                    $restriction_relationship = 'allow';
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php and 1 other location - About 1 hr to fix
Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 4337..4350

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

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 $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 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 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 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 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 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 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
                    Severity
                    Category
                    Status
                    Source
                    Language