Showing 375 of 503 total issues
File admin-form-builder.js
has 1714 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Torro Forms Version 1.0.8 (https://torro-forms.com)
* Licensed under GNU General Public License v2 (or later) (http://www.gnu.org/licenses/gpl-2.0.html)
*/
window.torro = window.torro || {};
Function upgrade_legacy_form_meta
has a Cognitive Complexity of 118 (exceeds 5 allowed). Consider refactoring. Open
public function upgrade_legacy_form_meta( $form_id ) {
global $wpdb;
$prefix = $this->get_prefix();
- 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
File form-edit-page-handler.php
has 751 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Form edit page handler class
*
* @package TorroForms
Function handle_form_submission
has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring. Open
protected function handle_form_submission( $form, $submission, $data = array() ) {
if ( $submission->has_errors() ) {
$submission->reset_errors();
}
- 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 get_values
has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring. Open
public function get_values( $element, $submission = null ) {
$values = array();
if ( $submission ) {
$all_values = $submission->get_element_values_data();
if ( isset( $all_values[ $element->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
Function can_access
has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring. Open
public function can_access( $form, $submission = null ) {
if ( $this->get_form_option( $form->id, 'prevent_edit_others_submission', true ) && $submission ) {
$others_submission_error = new WP_Error( 'others_submission', __( 'You do not have access to this form submission.', 'torro-forms' ) );
$skip_further_checks = false;
- 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
File element-view.js
has 545 lines of code (exceeds 250 allowed). Consider refactoring. Open
( function( torro, $, _, fieldsAPI, dummyFieldManager ) {
'use strict';
function deepClone( input ) {
var output = _.clone( input );
File form-settings-page.php
has 534 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Form settings page class
*
* @package TorroForms
Method register_assets
has 211 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function register_assets() {
$this->register_style(
'frontend',
'assets/dist/css/frontend.css',
array(
Function parseFields
has 196 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseFields( fields, element ) {
var parsedFields = [];
var hasLabel = false;
_.each( fields, function( field ) {
Function parseFields
has 196 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseFields( fields, element ) {
var parsedFields = [];
var hasLabel = false;
_.each( fields, function( field ) {
File legacy-upgrades.php
has 473 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Legacy upgrades class
*
* @package TorroForms
Method upgrade_legacy_form_meta
has 169 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function upgrade_legacy_form_meta( $form_id ) {
global $wpdb;
$prefix = $this->get_prefix();
Function map_capabilities
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
public function map_capabilities( $mode ) {
$this->capability_mappings = array();
if ( $mode ) {
$this->capability_mappings[ $this->meta_capabilities['edit_item'] ] = array( $this, 'map_edit_item' );
- 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
File members.php
has 446 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Members access control class
*
* @package TorroForms
File email-notifications.php
has 443 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Email notifications action class
*
* @package TorroForms
Method register_template_tag_handlers
has 161 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function register_template_tag_handlers() {
$tags = array(
'sitetitle' => array(
'group' => 'global',
'label' => __( 'Site Title', 'torro-forms' ),
Method setup_hooks
has 159 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function setup_hooks() {
parent::setup_hooks();
if ( method_exists( $this, 'register_rest_routes' ) ) {
$this->filters[] = array(
File torro-forms.php
has 419 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Plugin main class
*
* @package TorroForms
Function upgrade_legacy_settings
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
public function upgrade_legacy_settings() {
$prefix = $this->get_prefix();
$general_mappings = array(
'modules' => array( $prefix . 'settings_general_modules', 'modules' ),
- 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"