Showing 92 of 92 total issues
Method altCoinCustomScript
has 301 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function altCoinCustomScript() {
global $woocommerce;
?>
<script type="text/javascript">
Method add_new_coin
has 222 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function add_new_coin( $args ) {
$coin_data = '';
$coin_addresses = array();
$hidden_block = ' hidden ';
Method track_coin
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function track_coin( $raw_data ) {
global $woocommerce;
$raw_data = $raw_data['form_data'];
$data = array();
Method calcualteCoinPrice
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function calcualteCoinPrice() {
global $woocommerce;
$coin_id = Util::check_evil_script( ( $_POST['data']['coin_id'] ) );
if ( empty( $coin_id ) ) {
Method generate_settings
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generate_settings( $args ) {
$settings_data = CsAutomaticOrderConfirmationSettings::get_order_confirm_settings_data();
$fields = array(
'cs_altcoin_config[cms_username]' => array(
File CsAdminQuery.php
has 338 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php namespace WooGateWayCoreLib\admin\functions;
/**
* Retrive Settings Data
*
Method add_new_coin
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function add_new_coin( $user_data ) {
global $wpdb, $wapg_tables;
$coin_info = Util::check_evil_script( $user_data['cs_add_new'] );
if ( empty( $coin_info['coin_address'] ) || empty( $coin_info['checkout_type'] ) || empty( $coin_info['coin_name'] ) ) {
File CsWapgScript.php
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php namespace WooGateWayCoreLib\frontend\scripts;
/**
* Frontend Script
*
Method cs_register_wapg_menu
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function cs_register_wapg_menu() {
global $altcoin_menu;
add_menu_page(
__( 'WooAltCoin Payment', 'woo-altcoin-payment-gateway' ),
'AltCoin Payment',
Method generate_checkout_settings
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generate_checkout_settings( $args ) {
$settings = CsPaymentGateway::get_checkout_page_options();
$fields = array(
'st1' => array(
Function generate_field
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private function generate_field( $field_name, $field, $field_id ) {
$input = '<div class="label"><label>';
$input .= $this->generate_title( $field );
$input .= '</label></div>';
$input .= '<div class="input-group">';
- Read upRead up
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 track_coin
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function track_coin( $raw_data ) {
global $woocommerce;
$raw_data = $raw_data['form_data'];
$data = array();
- Read upRead up
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 calcualteCoinPrice
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function calcualteCoinPrice() {
global $woocommerce;
$coin_id = Util::check_evil_script( ( $_POST['data']['coin_id'] ) );
if ( empty( $coin_id ) ) {
- Read upRead up
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 generate_product_options_settings
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generate_product_options_settings( $args ) {
$fields = array(
'st1' => array(
'type' => 'section_title',
Function check_db_status
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public static function check_db_status() {
global $wapg_current_db_version, $wpdb, $wapg_tables;
$get_installed_db_version = get_site_option( 'wapg_db_version' );
if ( empty( $get_installed_db_version ) ) {
self::on_activate();
- Read upRead up
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 udpate_coin
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function udpate_coin( $user_data ) {
global $wpdb, $wapg_tables;
$coin_info = Util::check_evil_script( $user_data['cs_add_new'] );
$more_address_fields = Util::check_evil_script( $user_data['more_coin_address'] );
Method generate_default_settings
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generate_default_settings( $args ) {
$settings = isset( $args['gateway_settings'] ) ? (object) $args['gateway_settings'] : '';
$option = isset( $settings->defaultOptn ) ? $settings->defaultOptn : '';
Util
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class Util {
/**
* Encode Html Entites
Function widget_get_live_coin_prices
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function widget_get_live_coin_prices( $user_data ) {
// get widget options
$widget_options = CsSaveWidgetOptions::get_widget_options();
- Read upRead up
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
CsFormBuilder
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class CsFormBuilder {
/**
* Generate html form fields
*