dynamic/foxystripe

View on GitHub

Showing 127 of 127 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if (slider.vars.controlsContainer !== "") slider.controlsContainer = $(slider.vars.controlsContainer).length > 0 && $(slider.vars.controlsContainer);
Severity: Major
Found in thirdparty/flexslider/jquery.flexslider.js and 1 other location - About 1 hr to fix
thirdparty/flexslider/jquery.flexslider.js on lines 76..76

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 67.

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

Further Reading

Function queryNewValue has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        queryNewValue = function (code, newValue, link, id, clicked) {
            var quantData = {
                'code': code,
                'value': newValue,
                'id': id,
Severity: Minor
Found in client/src/javascript/quantity.js - About 1 hr to fix

Function setup has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        setup: function() {
          slider.asNav = true;
          slider.animatingTo = Math.floor(slider.currentSlide/slider.move);
          slider.currentItem = slider.currentSlide;
          slider.slides.removeClass(namespace + "active-slide").eq(slider.currentItem).addClass(namespace + "active-slide");
Severity: Minor
Found in thirdparty/flexslider/jquery.flexslider.js - About 1 hr to fix

Function queryNewValue has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        queryNewValue = function (code, newValue, link, id, clicked) {
            var quantData = {
                'code': code,
                'value': newValue,
                'id': id,
Severity: Minor
Found in javascript/quantity.js - About 1 hr to fix

Method parseOrderDetails has 36 lines of code (exceeds 25 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 1 hr to fix

Function fc_hash_querystring has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function fc_hash_querystring($qs, $output = true)
    {
        self::$log[] = '<strong>Signing link</strong> with data: '
            .htmlspecialchars(substr($qs, 0, 150)).'...';
        $fail = self::$cart_url.'?'.$qs;
Severity: Minor
Found in src/Model/foxycart.cart_validation.php - About 1 hr 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 setupPaging has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        setupPaging: function() {
          var type = (slider.vars.controlNav === "thumbnails") ? 'control-thumbs' : 'control-paging',
              j = 1,
              item,
              slide;
Severity: Minor
Found in thirdparty/flexslider/jquery.flexslider.js - About 1 hr to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                        self::$log[] = '<strong>OPTION:</strong> Code: <strong>'.htmlspecialchars($prefix.$code).
                           '</strong> :: Name: <strong>'.htmlspecialchars($prefix.$list[2]).
                           '</strong> :: Value: <strong>'.htmlspecialchars($option[2]).
                           '</strong><br />Initial option: '.htmlspecialchars($option[0]).
                           '<br />Signed: <span style="color:#060;">'.htmlspecialchars($option_signed).'</span>';
Severity: Major
Found in src/Model/foxycart.cart_validation.php and 1 other location - About 1 hr to fix
src/Model/foxycart.cart_validation.php on lines 412..416

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 107.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                    self::$log[] = '<strong>TEXTAREA:</strong> Code: <strong>'.htmlspecialchars($prefix.$code).
                       '</strong> :: Name: <strong>'.htmlspecialchars($prefix.$textarea[2]).
                       '</strong> :: Value: <strong>'.htmlspecialchars($textarea[3]).
                       '</strong><br />Initial textarea: '.htmlspecialchars($textarea[0]).
                       '<br />Signed: <span style="color:#060;">'.htmlspecialchars($textarea_signed).'</span>';
Severity: Major
Found in src/Model/foxycart.cart_validation.php and 1 other location - About 1 hr to fix
src/Model/foxycart.cart_validation.php on lines 378..382

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 107.

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

Further Reading

Method getProductOptionSet has 33 lines of code (exceeds 25 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 1 hr to fix

Function Brush has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function Brush()
    {
        function process(match, regexInfo)
        {
            var constructor = SyntaxHighlighter.Match,
Severity: Minor
Found in thirdparty/flexslider/demo/js/shBrushXml.js - About 1 hr to fix

Method index has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function index()
    {
        $rules = Director::config()->get('rules');
        $rule = array_search(FoxyStripeController::class, $rules);
        $myURL = Director::absoluteBaseURL() . explode('//', $rule)[0];
Severity: Minor
Found in src/Controller/DataTestController.php - About 1 hr to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        var keywords =    'ascent azimuth background-attachment background-color background-image background-position ' +
                        'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' +
                        'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' +
                        'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' +
                        'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' +
Severity: Major
Found in thirdparty/flexslider/demo/js/shBrushCss.js and 1 other location - About 1 hr to fix
thirdparty/flexslider/demo/js/shBrushCss.js on lines 49..62

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 59.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        var values =    'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+
                        'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+
                        'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero default digits disc dotted double '+
                        'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+
                        'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+
Severity: Major
Found in thirdparty/flexslider/demo/js/shBrushCss.js and 1 other location - About 1 hr to fix
thirdparty/flexslider/demo/js/shBrushCss.js on lines 34..47

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 59.

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

Further Reading

Method encrypt has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    static function encrypt ($pwd, $data, $ispwdHex = 0)
    {
        if ($ispwdHex)
            $pwd = @pack('H*', $pwd); // valid input, please!
 
Severity: Minor
Found in thirdparty/rc4crypt.php - About 1 hr to fix

Function setProps has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    slider.setProps = function(pos, special, dur) {
      var target = (function() {
        var posCheck = (pos) ? pos : ((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.animatingTo,
            posCalc = (function() {
              if (carousel) {
Severity: Minor
Found in thirdparty/flexslider/jquery.flexslider.js - About 1 hr to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
Severity: Major
Found in thirdparty/flexslider/demo/js/jquery.easing.js and 1 other location - About 1 hr to fix
thirdparty/flexslider/demo/js/jquery.easing.js on lines 138..138

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 58.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
Severity: Major
Found in thirdparty/flexslider/demo/js/jquery.easing.js and 1 other location - About 1 hr to fix
thirdparty/flexslider/demo/js/jquery.easing.js on lines 124..124

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 58.

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

Further Reading

Method setCurrentStore has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

Severity: Minor
Found in src/Model/FoxyStripeClient.php - About 1 hr to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

              methods.uniqueID( slider.slides.first().clone().addClass('clone').attr('aria-hidden', 'true') ).appendTo( slider.container );
Severity: Major
Found in thirdparty/flexslider/jquery.flexslider.js and 1 other location - About 1 hr to fix
thirdparty/flexslider/jquery.flexslider.js on lines 876..876

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 57.

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

Further Reading

Severity
Category
Status
Source
Language