dynamic/foxystripe

View on GitHub

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;
Severity: Minor
Found in thirdparty/flexslider/jquery.flexslider.js - About 1 hr to fix

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',
Severity: Minor
Found in src/Model/foxycart.cart_validation.php - About 55 mins 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 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 = [];
Severity: Minor
Found in src/Model/FoxyStripeClient.php - About 55 mins 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

Method __construct has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $controller,
        $name,
        FieldList $fields = null,
        FieldList $actions = null,
        $validator = null,
Severity: Major
Found in src/Form/FoxyStripePurchaseForm.php - About 50 mins to fix

Function easeOutBack has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    easeOutBack: function (x, t, b, c, d, s) {
Severity: Minor
Found in thirdparty/flexslider/demo/js/jquery.easing.js - About 45 mins to fix

Method getGeneratedValue has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $productCode = null,
        $optionName = null,
        $optionValue = null,
        $method = 'name',
        $output = false,
Severity: Minor
Found in src/Page/ProductPage.php - About 45 mins to fix

Method fc_hash_value has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $product_code,
        $option_name,
        $option_value = '',
        $method = 'name',
        $output = true,
Severity: Minor
Found in src/Model/foxycart.cart_validation.php - About 45 mins to fix

Function easeInOutBack has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    easeInOutBack: function (x, t, b, c, d, s) {
Severity: Minor
Found in thirdparty/flexslider/demo/js/jquery.easing.js - About 45 mins to fix

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;
Severity: Minor
Found in src/Controller/FoxyStripeController.php - About 45 mins 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 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) {
Severity: Minor
Found in src/Page/ProductHolder.php - About 45 mins 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 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) {
Severity: Minor
Found in src/Model/Order.php - About 45 mins 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 easeInBack has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    easeInBack: function (x, t, b, c, d, s) {
Severity: Minor
Found in thirdparty/flexslider/demo/js/jquery.easing.js - About 45 mins to fix

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');
Severity: Minor
Found in src/Form/FoxyStripePurchaseForm.php - About 45 mins 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

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;
Severity: Major
Found in src/Model/FoxyStripeClient.php - About 45 mins to fix

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());
Severity: Major
Found in thirdparty/flexslider/jquery.flexslider.js - About 40 mins to fix

Function queryNewValue has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        queryNewValue = function (code, newValue, link, id, clicked) {
Severity: Minor
Found in client/src/javascript/quantity.js - About 35 mins to fix

Function easeOutElastic has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    easeOutElastic: function (x, t, b, c, d) {
Severity: Minor
Found in thirdparty/flexslider/demo/js/jquery.easing.js - About 35 mins to fix

Function easeInOutExpo has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    easeInOutExpo: function (x, t, b, c, d) {
Severity: Minor
Found in thirdparty/flexslider/demo/js/jquery.easing.js - About 35 mins to fix

Function easeInSine has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    easeInSine: function (x, t, b, c, d) {
Severity: Minor
Found in thirdparty/flexslider/demo/js/jquery.easing.js - About 35 mins to fix

Function flexAnimate has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    slider.flexAnimate = function(target, pause, override, withSync, fromNav) {
Severity: Minor
Found in thirdparty/flexslider/jquery.flexslider.js - About 35 mins to fix
Severity
Category
Status
Source
Language