dynamic/foxystripe

View on GitHub

Showing 96 of 127 total issues

Function flexslider has 808 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  $.flexslider = function(el, options) {
    var slider = $(el);

    // making variables public
    slider.vars = $.extend({}, $.flexslider.defaults, options);
Severity: Major
Found in thirdparty/flexslider/jquery.flexslider.js - About 4 days to fix

File jquery.flexslider.js has 895 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * jQuery FlexSlider v2.2.2
 * Copyright 2012 WooThemes
 * Contributing Author: Tyler Smith
 */
Severity: Major
Found in thirdparty/flexslider/jquery.flexslider.js - About 2 days to fix

Function fc_hash_html has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
Open

    public static function fc_hash_html($html)
    {
        // Initialize some counting
        $count['temp'] = 0; // temp counter
        $count['links'] = 0;
Severity: Minor
Found in src/Model/foxycart.cart_validation.php - About 1 day 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 fc_hash_html has 202 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function fc_hash_html($html)
    {
        // Initialize some counting
        $count['temp'] = 0; // temp counter
        $count['links'] = 0;
Severity: Major
Found in src/Model/foxycart.cart_validation.php - About 1 day to fix

Method getCMSFields has 193 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getCMSFields()
    {
        $fields = FieldList::create(
            TabSet::create(
                'Root',
Severity: Major
Found in src/Model/FoxyStripeSetting.php - About 7 hrs to fix

File FoxyStripeSetting.php has 415 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace Dynamic\FoxyStripe\Model;

use Dynamic\CountryDropdownField\Fields\CountryDropdownField;
Severity: Minor
Found in src/Model/FoxyStripeSetting.php - About 5 hrs to fix

Function touch has 139 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      touch: function() {
        var startX,
          startY,
          offset,
          cwidth,
Severity: Major
Found in thirdparty/flexslider/jquery.flexslider.js - About 5 hrs to fix

Method getCMSFields has 121 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getCMSFields()
    {
        $fields = parent::getCMSFields();

        $fields->removeByName([
Severity: Major
Found in src/Model/OptionItem.php - About 4 hrs to fix

File ProductPage.php has 337 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace Dynamic\FoxyStripe\Page;

use Bummzack\SortableFile\Forms\SortableUploadField;
Severity: Minor
Found in src/Page/ProductPage.php - About 4 hrs to fix

`` has 31 functions (exceeds 20 allowed). Consider refactoring.
Open

{
    def: 'easeOutQuad',
    swing: function (x, t, b, c, d) {
        //alert(jQuery.easing.default);
        return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
Severity: Minor
Found in thirdparty/flexslider/demo/js/jquery.easing.js - About 3 hrs to fix

File foxycart.cart_validation.php has 326 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

use Dynamic\FoxyStripe\Model\FoxyCart;

/**
Severity: Minor
Found in src/Model/foxycart.cart_validation.php - About 3 hrs to fix

Method getCMSFields has 95 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getCMSFields()
    {
        $this->beforeUpdateCMSFields(function (FieldList $fields) {
            // Cateogry Dropdown field w/ add new
            $source = function () {
Severity: Major
Found in src/Page/ProductPage.php - About 3 hrs to fix

Method getProductFields has 88 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function getProductFields(FieldList $fields)
    {
        //Requirements::javascript('dynamic/foxystripe: client/dist/javascript/scripts.min.js');
        $hiddenTitle = ($this->product->ReceiptTitle) ?
            htmlspecialchars($this->product->ReceiptTitle) :
Severity: Major
Found in src/Form/FoxyStripePurchaseForm.php - About 3 hrs to fix

Function setCurrentStore has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    public function setCurrentStore()
    {
        $client = $this->getClient();
        $config = FoxyStripeSetting::current_foxystripe_setting();

Severity: Minor
Found in src/Model/FoxyStripeClient.php - About 3 hrs 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 init has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      init: function() {
        slider.animating = false;
        // Get current slide and make sure it is a number
        slider.currentSlide = parseInt( ( slider.vars.startAt ? slider.vars.startAt : 0), 10 );
        if ( isNaN( slider.currentSlide ) ) slider.currentSlide = 0;
Severity: Major
Found in thirdparty/flexslider/jquery.flexslider.js - About 3 hrs to fix

Function flexAnimate has 75 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    slider.flexAnimate = function(target, pause, override, withSync, fromNav) {
      if (!slider.vars.animationLoop && target !== slider.currentSlide) {
        slider.direction = (target > slider.currentSlide) ? "next" : "prev";
      }

Severity: Major
Found in thirdparty/flexslider/jquery.flexslider.js - About 3 hrs to fix

Function parseOrderDetails has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function parseOrderDetails($response)
    {

        // remove previous OrderDetails and OrderOptions so we don't end up with duplicates
        foreach ($this->Details() as $detail) {
Severity: Minor
Found in src/Model/Order.php - About 2 hrs 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 getCMSFields has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getCMSFields()
    {
        $fields = parent::getCMSFields();

        if ($this->ID) {
Severity: Major
Found in src/Model/ProductCategory.php - About 2 hrs to fix

File OptionItem.php has 266 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace Dynamic\FoxyStripe\Model;

use Dynamic\FoxyStripe\Page\ProductPage;
Severity: Minor
Found in src/Model/OptionItem.php - About 2 hrs to fix

Function getProductFields has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getProductFields(FieldList $fields)
    {
        //Requirements::javascript('dynamic/foxystripe: client/dist/javascript/scripts.min.js');
        $hiddenTitle = ($this->product->ReceiptTitle) ?
            htmlspecialchars($this->product->ReceiptTitle) :
Severity: Minor
Found in src/Form/FoxyStripePurchaseForm.php - About 2 hrs 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

Severity
Category
Status
Source
Language