3scale/porta

View on GitHub
app/assets/javascripts/provider/plans_widget.js

Summary

Maintainability
B
5 hrs
Test Coverage

Showing 4 of 4 total issues

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

loadPreview: function(planID, callback, url, application_id, upgradeToId){
Severity: Minor
Found in app/assets/javascripts/provider/plans_widget.js - About 35 mins to fix

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

    box.find(".select-plan-button").click(function(){
    var planID = $(this).attr('data-plan-id');
    var planName = $(this).attr('data-plan-name');
    box.fadeOut();
    PlanWidget.callback(planName, planID);
    Severity: Major
    Found in app/assets/javascripts/provider/plans_widget.js and 1 other location - About 2 hrs to fix
    lib/developer_portal/app/assets/javascripts/plans_widget.js on lines 69..74

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

    box.find('.plans-menu li a').click(function(){
    var planID = $(this).attr('data-plan-id');
    PlanWidget.showPlan(previewBoxId, planID);
    });
    Severity: Major
    Found in app/assets/javascripts/provider/plans_widget.js and 1 other location - About 1 hr to fix
    lib/developer_portal/app/assets/javascripts/plans_widget.js on lines 83..86

    Identical blocks of code found in 3 locations. Consider refactoring.
    Open

    if ($("#" + previewBoxId).length == 1) {
    $("#" + previewBoxId).fadeIn('fast', function () {
    PlanWidget.markCurrentPlan(previewBoxId);
    PlanWidget.showPlan(previewBoxId);
    });
    Severity: Major
    Found in app/assets/javascripts/provider/plans_widget.js and 2 other locations - About 50 mins to fix
    lib/developer_portal/app/assets/javascripts/plans_widget.js on lines 10..23
    lib/developer_portal/app/assets/javascripts/plans_widget_v2.js on lines 18..34

    There are no issues that match your filters.

    Category
    Status