Showing 96 of 127 total issues
Function doMath
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
slider.doMath = function() {
var slide = slider.slides.first(),
slideMargin = slider.vars.itemMargin,
minItems = slider.vars.minItems,
maxItems = slider.vars.maxItems;
- Create a ticketCreate a ticket
Function fc_hash_value
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function fc_hash_value(
$product_code,
$option_name,
$option_value = '',
$method = 'name',
- Read upRead up
- Create a ticketCreate a ticket
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 getCategory
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getCategory($code)
{
if ($categoriesURL = $this->getItemCategoriesURL()) {
$client = $this->getClient();
$errors = [];
- Read upRead up
- Create a ticketCreate a ticket
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 __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$controller,
$name,
FieldList $fields = null,
FieldList $actions = null,
$validator = null,
- Create a ticketCreate a ticket
Function easeOutBack
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
easeOutBack: function (x, t, b, c, d, s) {
- Create a ticketCreate a ticket
Method getGeneratedValue
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$productCode = null,
$optionName = null,
$optionValue = null,
$method = 'name',
$output = false,
- Create a ticketCreate a ticket
Method fc_hash_value
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$product_code,
$option_name,
$option_value = '',
$method = 'name',
$output = true,
- Create a ticketCreate a ticket
Function easeInOutBack
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInOutBack: function (x, t, b, c, d, s) {
- Create a ticketCreate a ticket
Function parseOrderCustomer
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function parseOrderCustomer($orders, $transaction)
{
foreach ($orders->transactions->transaction as $order) {
if (!isset($order->customer_email) || $order->is_anonymous != 0) {
continue;
- Read upRead up
- Create a ticketCreate a ticket
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 ProductList
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function ProductList($limit = 10)
{
$config = FoxyStripeSetting::current_foxystripe_setting();
if ($config->ProductLimit > 0) {
- Read upRead up
- Create a ticketCreate a ticket
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 parseOrderCustomer
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function parseOrderCustomer($response)
{
foreach ($response->transactions->transaction as $transaction) {
// if not a guest transaction in FoxyCart
if (isset($transaction->customer_email) && $transaction->is_anonymous == 0) {
- Read upRead up
- Create a ticketCreate a ticket
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 easeInBack
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInBack: function (x, t, b, c, d, s) {
- Create a ticketCreate a ticket
Function getProductOptionSet
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function getProductOptionSet()
{
$options = $this->product->ProductOptions();
$groupedOptions = new GroupedList($options);
$groupedBy = $groupedOptions->groupBy('ProductOptionGroupID');
- Read upRead up
- Create a ticketCreate a ticket
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
Avoid deeply nested control flow statements. Open
if ($result = $client->get($store_exists_uri, $data)) {
$errors = array_merge($errors, $client->getErrors($result));
if ($store = $client->getLink('fx:store')) {
$errors = array_merge($errors, $client->getErrors($store));
$this->current_store = $store;
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
} else if ( ( window.navigator.msPointerEnabled ) || e.touches.length === 1 ) {
slider.pause();
// CAROUSEL:
cwidth = (vertical) ? slider.h : slider. w;
startT = Number(new Date());
- Create a ticketCreate a ticket
Function queryNewValue
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
queryNewValue = function (code, newValue, link, id, clicked) {
- Create a ticketCreate a ticket
Function easeOutElastic
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeOutElastic: function (x, t, b, c, d) {
- Create a ticketCreate a ticket
Function easeInOutExpo
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInOutExpo: function (x, t, b, c, d) {
- Create a ticketCreate a ticket
Function easeInSine
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInSine: function (x, t, b, c, d) {
- Create a ticketCreate a ticket
Function flexAnimate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
slider.flexAnimate = function(target, pause, override, withSync, fromNav) {
- Create a ticketCreate a ticket