wp-plugins/all-in-one-seo-pack

View on GitHub

Showing 399 of 427 total issues

Function return_module has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

        function return_module( $class ) {
            global $aiosp;
            if ( $class == get_class( $aiosp ) )    return $aiosp;
            if ( $class == get_class( $this ) )        return $this;
            foreach( $this->modules as $m )
Severity: Minor
Found in aioseop_module_manager.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_all_tags has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    function get_all_tags( $id = 0 ) {
        $keywords = Array();
        $tags = get_the_tags( $id );
        if ( !empty( $tags ) && is_array( $tags) )
            foreach ( $tags as $tag )
Severity: Minor
Found in aioseop_class.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 from_request has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

      public static function from_request($http_method=NULL, $http_url=NULL, $parameters=NULL) {
        $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on")
                  ? 'http'
                  : 'https';
        $http_url = ($http_url) ? $http_url : $scheme .
Severity: Minor
Found in OAuth.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 localize_script_data has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

        function localize_script_data( $data ) {
            if ( !is_array( $data ) ) {
                $data = Array( 0 => $data );
            }
            if ( empty( $this->script_data ) ) $this->script_data = Array();
Severity: Minor
Found in aioseop_module_class.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 aioseop_ajax_delete_url has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    function aioseop_ajax_delete_url() {
        aioseop_ajax_init();
        $options = Array();
        $options = esc_attr( $_POST['options'] );
        $_POST['action'] = 'aiosp_update_module';
Severity: Minor
Found in aioseop_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 filter_metabox_options has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

        function filter_metabox_options( $options, $location, $post_id ) {
            if ( $location == 'settings' ) {
                $prefix = $this->get_prefix( $location ) . $location;
                if ( !empty( $options[$prefix . '_customimg'] ) ) {
                    $old_options = get_post_meta( $post_id, '_' . $prefix );
Severity: Minor
Found in aioseop_opengraph.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 override_options has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

        function override_options( $options, $location, $settings ) {
            $opts = Array();
            foreach ( $settings as $k => $v ) if ( $v['save'] ) $opts[$k] = $v['default'];
            foreach( $options as $k => $v ) if ( $v === NULL ) unset( $options[$k] );
            $options = wp_parse_args( $options, $opts );
Severity: Minor
Found in aioseop_opengraph.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_total_post_count has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

        function get_total_post_count( $args ) {
            $total = 0;
            $counts = $this->get_all_post_counts( $args );
            if ( !empty( $counts ) )
                if ( is_array( $counts ) )
Severity: Minor
Found in aioseop_sitemap.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 add_attributes has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

        function add_attributes( $output ) { // avoid having duplicate meta tags
            $type = $this->type;
            if ( empty( $type ) ) $type = 'website';
            
            $schema_types = Array(
Severity: Minor
Found in aioseop_opengraph.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 All_in_One_SEO_Pack_Opengraph has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

        function All_in_One_SEO_Pack_Opengraph( ) {
            $this->name = __('Social Meta', 'all-in-one-seo-pack');    // Human-readable name of the plugin
            $this->prefix = 'aiosp_opengraph_';                        // option prefix
            $this->file = __FILE__;                                    // the current file
            $this->fb_object_types = Array(
Severity: Minor
Found in aioseop_opengraph.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 countChars has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function countChars(field,cntfield) {
    var extra = 0;
    var field_size;
    if ( ( field.name == 'aiosp_title' ) && ( typeof aiosp_title_extra !== 'undefined' ) ) {
        extra = aiosp_title_extra;
Severity: Minor
Found in aioseop_module.js - 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 settings_update_action has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

        function settings_update_action( $options, $location ) {
            if ( $location == null ) {
                if ( isset( $_POST[ $this->prefix . 'force_rewrites' ] ) ) {
                    $force_rewrites = $_POST[ $this->prefix . 'force_rewrites' ];
                    if ( ( $force_rewrites == 0 ) || ( $force_rewrites == 1 ) ) {
Severity: Minor
Found in aioseop_performance.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 get_ini_file has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function get_ini_file( $assoc_arr, $has_sections=TRUE ) { 
            $content = ""; 
            if ($has_sections) { 
                foreach ($assoc_arr as $key=>$elem) { 
                    $content .= "[".$key."]\n"; 
Severity: Minor
Found in aioseop_importer_exporter.php - About 1 hr to fix

    Method enqueue_metabox_scripts has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function enqueue_metabox_scripts( ) {
                $screen = '';
                if ( function_exists( 'get_current_screen' ) )
                    $screen = get_current_screen();
                $bail = false;
    Severity: Minor
    Found in aioseop_module_class.php - About 1 hr to fix

      Method get_the_image_by_attachment has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function get_the_image_by_attachment( $p = null ) {
                  
                  if ( $p === null ) {
                      global $post;
                  } else {
      Severity: Minor
      Found in aioseop_module_class.php - About 1 hr to fix

        Method aioseop_mrt_pccolumn has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function aioseop_mrt_pccolumn($aioseopcn, $aioseoppi) {
                $id = $aioseoppi;
                $target = null;
                if( $aioseopcn == 'seotitle' ) $target = 'title';
                if( $aioseopcn == 'seokeywords' ) $target = 'keywords';
        Severity: Minor
        Found in aioseop_functions.php - About 1 hr to fix

          Method aioseop_addmycolumns has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function aioseop_addmycolumns() {
                  global $aioseop_options, $pagenow;
                  $aiosp_posttypecolumns = Array();
                  if ( !empty( $aioseop_options) && !empty( $aioseop_options['aiosp_posttypecolumns'] ) ) {
                      $aiosp_posttypecolumns = $aioseop_options['aiosp_posttypecolumns'];            
          Severity: Minor
          Found in aioseop_functions.php - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                    if ( !is_home() && !is_page() && !is_single() && !$this->is_static_front_page() && !$this->is_static_posts_page() && !is_archive() && !is_post_type_archive() )
                        return null;
            Severity: Major
            Found in aioseop_class.php - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                          if ( ( $mod == 'file_editor' || $mod == 'robots' )
                                                       && ( ( ( defined( 'DISALLOW_FILE_EDIT' ) && DISALLOW_FILE_EDIT ) 
                                                       || ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS )
                                                       || !is_super_admin() ) ) )
                              return false;
              Severity: Major
              Found in aioseop_module_manager.php - About 1 hr to fix

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

                    function get_blog_page( $p = null ) {
                        static $blog_page = '';
                        static $page_for_posts = '';
                        if ( $p === null ) {
                            global $post;
                Severity: Minor
                Found in aioseop_class.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

                Severity
                Category
                Status
                Source
                Language