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

View on GitHub
aioseop_module.js

Summary

Maintainability
B
6 hrs
Test Coverage

File aioseop_module.js has 300 lines of code (exceeds 250 allowed). Consider refactoring.
Open

if ( typeof aiosp_data != 'undefined' ) {
    jQuery.each( aiosp_data, function( index, value ) {
//        aiosp_data[index] = value.json.replace(/"/g, '"');
//        aiosp_data[index] = jQuery.parseJSON( value );
        if ( index == 0 ) {
Severity: Minor
Found in aioseop_module.js - About 3 hrs to fix

    Function aioseop_eval_condshow_logic has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    function aioseop_eval_condshow_logic( statement ) {
        var lhs, rhs;
        if ( ( typeof statement ) == 'object' ) {
            lhs = statement['lhs'];
            rhs = statement['rhs'];
    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 aioseop_do_condshow_match has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function aioseop_do_condshow_match( index, value ) {
        if ( typeof value != 'undefined' ) {
            matches = true;
            jQuery.each(value, function(subopt, setting) {
                var statement;
    Severity: Minor
    Found in aioseop_module.js - About 1 hr to fix

      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

      There are no issues that match your filters.

      Category
      Status