Showing 96 of 96 total issues
Function map_bigtitle_section
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function map_bigtitle_section() {
if ( isset( $this->previous_theme_content['zerif_bigtitle_show'] ) && $this->previous_theme_content['zerif_bigtitle_show'] ) {
unset( $this->content[0] );
return;
- 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
Similar blocks of code found in 3 locations. Consider refactoring. Open
Vue.http({
url: themeisleSitesLibApi.root + '/import_theme_mods',
method: 'POST',
headers: {'X-WP-Nonce': themeisleSitesLibApi.nonce},
params: {
- Read upRead up
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 88.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
Vue.http({
url: themeisleSitesLibApi.root + '/import_widgets',
method: 'POST',
headers: {'X-WP-Nonce': themeisleSitesLibApi.nonce},
params: {
- Read upRead up
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 88.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
Vue.http({
url: themeisleSitesLibApi.root + '/dismiss_migration',
method: 'POST',
headers: {'X-WP-Nonce': themeisleSitesLibApi.nonce},
params: {
- Read upRead up
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 88.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method map_bigtitle_section
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function map_bigtitle_section() {
if ( isset( $this->previous_theme_content['zerif_bigtitle_show'] ) && $this->previous_theme_content['zerif_bigtitle_show'] ) {
unset( $this->content[0] );
return;
Function map_ribbon_section
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function map_ribbon_section() {
if ( ! empty( $this->previous_theme_content['zerif_ribbon_background'] ) ) {
$this->content[2]['settings']['background_color'] = wp_kses_post( $this->previous_theme_content['zerif_ribbon_background'] );
}
- 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 actions.js
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* jshint esversion: 6 */
/* global themeisleSitesLibApi, console */
import Vue from 'vue'
import VueResource from 'vue-resource'
Method map_ribbon_section
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
function map_ribbon_section() {
if ( ! empty( $this->previous_theme_content['zerif_ribbon_background'] ) ) {
$this->content[2]['settings']['background_color'] = wp_kses_post( $this->previous_theme_content['zerif_ribbon_background'] );
}
Function get_repeater_social
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function get_repeater_social( $social_name, $value ) {
$result = array(
'icon' => '',
'link' => $value,
);
- 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_upsell_templates
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function get_upsell_templates() {
if ( $this->valid_lic === true ) {
return array();
}
$returnable = 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 get_remote_templates
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function get_remote_templates() {
if ( $this->valid_lic === false ) {
return 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
Method get_repeater_social
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function get_repeater_social( $social_name, $value ) {
$result = array(
'icon' => '',
'link' => $value,
);
Method map_our_focus_section
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function map_our_focus_section() {
if ( isset( $this->previous_theme_content['zerif_ourfocus_show'] ) && $this->previous_theme_content['zerif_ourfocus_show'] ) {
unset( $this->content[1] );
return;
Method import_theme_mods
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function import_theme_mods( WP_REST_Request $request ) {
if ( ! current_user_can( 'customize' ) ) {
return new WP_REST_Response(
array(
'data' => 'ti__ob_permission_err_2',
Method import_zelle_frontpage
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function import_zelle_frontpage( $template_path ) {
$this->previous_theme_content = get_option( 'theme_mods_zerif-pro' );
if ( empty( $this->previous_theme_content ) ) {
$this->previous_theme_content = get_option( 'theme_mods_zerif-lite' );
}
Method fetch_remote_file
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function fetch_remote_file( $url, $post ) {
// extract the file name and extension from the url
$file_name = basename( $url );
// get placeholder file in the upload dir with a unique, sanitized filename
Method map_testimonials_section
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function map_testimonials_section() {
if ( isset( $this->previous_theme_content['zerif_testimonials_show'] ) && $this->previous_theme_content['zerif_testimonials_show'] ) {
unset( $this->content[5] );
return;
Method parse_term_node
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parse_term_node( $node, $type = 'term' ) {
$data = array();
$meta = array();
$tag_name = array(
Method install_single_plugin
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function install_single_plugin( $plugin_slug ) {
$plugin_dir = WP_PLUGIN_DIR . '/' . $plugin_slug;
if ( is_dir( $plugin_dir ) ) {
return;
Function map_our_focus_section
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function map_our_focus_section() {
if ( isset( $this->previous_theme_content['zerif_ourfocus_show'] ) && $this->previous_theme_content['zerif_ourfocus_show'] ) {
unset( $this->content[1] );
return;
- 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"