CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Function date_rfc850 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    function date_rfc850($date)
    {
        static $pcre;
        if (!$pcre)
        {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 55 mins 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_all_user_settings has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function get_all_user_settings() {
    global $_updated_user_settings;

    if ( ! $user_id = get_current_user_id() )
        return array();
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/option.php - About 55 mins 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_post_comments_feed_link has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function get_post_comments_feed_link($post_id = '', $feed = '') {
    global $id;

    if ( empty($post_id) )
        $post_id = (int) $id;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/link-template.php - About 55 mins 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_decode has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function wp_specialchars_decode( $string, $quote_style = ENT_NOQUOTES ) {
    $string = (string) $string;

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

function _wptexturize_pushpop_element($text, &$stack, $disabled_elements, $opening = '<', $closing = '>') {
    // Check if it is a closing tag -- otherwise assume opening tag
    if (strncmp($opening . '/', $text, 2)) {
        // Opening? Check $text+1 against disabled elements
        if (preg_match('/^' . $disabled_elements . '\b/', substr($text, 1), $matches)) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 55 mins 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 SetMessageType has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  function SetMessageType() {
    if(count($this->attachment) < 1 && strlen($this->AltBody) < 1) {
      $this->message_type = 'plain';
    } else {
      if(count($this->attachment) > 0) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-phpmailer.php - About 55 mins 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 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function get( $header ) {
        if ( ! isset( $this->headers[ $header ] ) )
            return false;

        if ( ! isset( $this->headers_sanitized ) ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-theme.php - About 55 mins 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 UTF8CharBoundary has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  function UTF8CharBoundary($encodedText, $maxLength) {
    $foundSplitPos = false;
    $lookBack = 3;
    while (!$foundSplitPos) {
      $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-phpmailer.php - About 55 mins 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_all_user_settings has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function get_all_user_settings() {
    global $_updated_user_settings;

    if ( ! $user = wp_get_current_user() )
        return array();
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/functions.php - About 55 mins 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 update_site_option has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function update_site_option( $option, $value ) {
    global $wpdb;

    wp_protect_special_option( $option );

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/option.php - About 55 mins 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_get_active_and_valid_plugins has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function wp_get_active_and_valid_plugins() {
    $plugins = array();
    $active_plugins = (array) get_option( 'active_plugins', array() );

    // Check for hacks file if the option is enabled
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/load.php - About 55 mins 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_get_post_autosave has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function wp_get_post_autosave( $post_id, $user_id = 0 ) {
    $revisions = wp_get_post_revisions( $post_id, array( 'check_enabled' => false ) );

    foreach ( $revisions as $revision ) {
        if ( false !== strpos( $revision->post_name, "{$post_id}-autosave" ) ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/revision.php - About 55 mins 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_output_format has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function get_output_format( $filename = null, $mime_type = null ) {
        $new_ext = $file_ext = null;
        $file_mime = null;

        // By default, assume specified type takes priority
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-image-editor.php - About 55 mins 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 Authenticate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  function Authenticate($username, $password) {
    // Start authentication
    fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF);

    $rply = $this->get_lines();
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-smtp.php - About 55 mins 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_metadata has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function get_metadata($meta_type, $object_id, $meta_key = '', $single = false) {
    if ( !$meta_type )
        return false;

    $meta_cache = wp_cache_get($object_id, $meta_type . '_meta');
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/meta.php - About 55 mins 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 3 locations. Consider refactoring.
Open

        public List<News> GetNews(string year)
        {
            var tournament = Tournaments.Single(x => x.Year == year);
            var news = NewsArticles.Where(x => x.TournamentId == tournament.Id).ToList();
            return news;
Severity: Major
Found in ReadModels/TournamentQueries.cs and 2 other locations - About 55 mins to fix
ReadModels/TournamentQueries.cs on lines 149..154
ReadModels/TournamentQueries.cs on lines 214..219

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

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

        [HttpPost]
        [RestrictAccessByRouteId]
        public JsonResult SavePracticePlan(SavePracticePlan command)
        {
            if (command.Id == null || command.Id.Equals(Guid.Empty))
Severity: Major
Found in Web.Admin/Controllers/ContingentController.cs and 5 other locations - About 55 mins to fix
Web.Admin/Controllers/ContingentController.cs on lines 172..181
Web.Admin/Controllers/ContingentController.cs on lines 215..224
Web.Admin/Controllers/ContingentController.cs on lines 226..235
Web.Admin/Controllers/ContingentController.cs on lines 237..246
Web.Admin/Controllers/ContingentController.cs on lines 259..268

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

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

        public List<Centre> GetCentres(string year)
        {
            var tournament = Tournaments.Single(x => x.Year == year);
            var centres = Centres.Where(x => x.TournamentId == tournament.Id).ToList();
            return centres;
Severity: Major
Found in ReadModels/TournamentQueries.cs and 2 other locations - About 55 mins to fix
ReadModels/TournamentQueries.cs on lines 142..147
ReadModels/TournamentQueries.cs on lines 149..154

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

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

        public List<Hotel> GetHotels(string year)
        {
            var tournament = Tournaments.Single(x => x.Year == year);
            var hotels = Hotels.Where(x => x.TournamentId == tournament.Id).ToList();
            return hotels;
Severity: Major
Found in ReadModels/TournamentQueries.cs and 2 other locations - About 55 mins to fix
ReadModels/TournamentQueries.cs on lines 142..147
ReadModels/TournamentQueries.cs on lines 214..219

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

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

        [HttpPost]
        [RestrictAccessByRouteId]
        public JsonResult ChangeRoomType(ChangeRoomType command)
        {
            if (command.Id == null || command.Id.Equals(Guid.Empty))
Severity: Major
Found in Web.Admin/Controllers/ContingentController.cs and 5 other locations - About 55 mins to fix
Web.Admin/Controllers/ContingentController.cs on lines 172..181
Web.Admin/Controllers/ContingentController.cs on lines 226..235
Web.Admin/Controllers/ContingentController.cs on lines 237..246
Web.Admin/Controllers/ContingentController.cs on lines 248..257
Web.Admin/Controllers/ContingentController.cs on lines 259..268

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

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