GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

public/js/transaction-form.js   A
last analyzed

Complexity

Total Complexity 29
Complexity/F 1.53

Size

Lines of Code 1
Function Count 19

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
nc 9216
dl 0
loc 1
rs 10
c 1
b 0
f 0
wmc 29
mnd 1
bc 19
fnc 19
bpm 1
cpm 1.5263
noi 10
1
!function(e){function o(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,o),n.l=!0,n.exports}var t={};o.m=e,o.c=t,o.d=function(e,t,a){o.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},o.p="",o(o.s=2)}({2:function(e,o,t){e.exports=t("4uuz")},"4uuz":function(e,o){$(function(){kendo.ui.DropDownList.prototype.options=$.extend(kendo.ui.DropDownList.prototype.options,{noDataTemplate:Lang.get("mmex.no-data-found"),filter:"contains",dataTextField:"name",dataValueField:"id"}),$("#transaction_type").data("kendoDropDownList",new kendo.ui.DropDownList($("#transaction_type")[0],{dataSource:{data:mmex.dropDownOptions?mmex.dropDownOptions.types:[]},change:function(e){var o=e.sender.value();"Transfer"===e.sender.dataSource.get(o).slug?($("#to_account").data("kendoDropDownList").enable(!0),$("#payee").data("kendoDropDownList").enable(!1)):($("#to_account").data("kendoDropDownList").select(null),$("#to_account").data("kendoDropDownList").enable(!1),$("#payee").data("kendoDropDownList").enable(!0))}}));var e=$("#transaction_type").data("kendoDropDownList").dataItem();$("#transaction_status").length>0&&$("#transaction_status").data("kendoDropDownList",new kendo.ui.DropDownList($("#transaction_status")[0],{dataSource:{data:mmex.dropDownOptions?mmex.dropDownOptions.status:[]},optionLabel:Lang.get("mmex.please-choose")})),mmex.addPayee=function(e,o){var t=$("#"+e).data("kendoDropDownList"),a=t.dataSource;a.add({name:o}),a.one("sync",function(){t.select(a.view().length-1)}),a.sync()},$("#payee").data("kendoDropDownList",new kendo.ui.DropDownList($("#payee")[0],{noDataTemplate:$("#noDataAddNewTemplate").html(),enable:!e||"Transfer"!=e.slug,optionLabel:Lang.get("mmex.please-choose"),change:function(e){var o=e.sender.value(),t=e.sender.dataSource.get(o),a=t.category_id,n=t.sub_category_id;a&&($("#category").data("kendoDropDownList").value(a),n&&$("#subcategory").data("kendoDropDownList").value(n))},dataSource:{batch:!0,transport:{read:"/api/v1/payee",create:{url:"/api/v1/payee",dataType:"json",method:"POST"},parameterMap:function(e,o){if("read"!==o&&e.models)return _.first(e.models)}},schema:{model:{id:"id",fields:{id:{type:"number"},name:{type:"string"}}},data:"data"}}})),$("#account").data("kendoDropDownList",new kendo.ui.DropDownList($("#account")[0],{dataSource:{data:mmex.dropDownOptions?mmex.dropDownOptions.accounts:[]},optionLabel:Lang.get("mmex.please-choose"),change:function(e){var o=e.sender.value(),t=_.reject(mmex.dropDownOptions.accounts,function(e){return e.id===parseInt(o)}),a=$("#to_account").data("kendoDropDownList").dataSource;a.transport.data=t,a.read()}})),$("#to_account").data("kendoDropDownList",new kendo.ui.DropDownList($("#to_account")[0],{enable:!!e&&"Transfer"==e.slug,optionLabel:Lang.get("mmex.please-choose"),dataSource:{data:mmex.dropDownOptions?mmex.dropDownOptions.accounts:[]}})),$("#category").data("kendoDropDownList",new kendo.ui.DropDownList($("#category")[0],{height:300,optionLabel:Lang.get("mmex.please-choose"),dataSource:{serverFiltering:!1,transport:{read:"/api/v1/category/"},schema:{data:"data"}}})),$("#subcategory").data("kendoDropDownList",new kendo.ui.DropDownList($("#subcategory")[0],{autoBind:!1,cascadeFrom:"category",height:300,optionLabel:Lang.get("mmex.please-choose"),dataSource:{serverFiltering:!0,transport:{read:{dataType:"json",url:function(){return"/api/v1/category/"+$("#category").data("kendoDropDownList").value()+"/subcategories"}}},schema:{data:"data"}}})),$(".numeric-currency").each(function(e,o){new kendo.ui.NumericTextBox($(o)[0],{format:"c",decimals:2})})})}});
0 ignored issues
show
Complexity Best Practice introduced by
There is no return statement if "read" !== o && e.models is false. Are you sure this is correct? If so, consider adding return; explicitly.

This check looks for functions where a return statement is found in some execution paths, but not in all.

Consider this little piece of code

function isBig(a) {
    if (a > 5000) {
        return "yes";
    }
}

console.log(isBig(5001)); //returns yes
console.log(isBig(42)); //returns undefined

The function isBig will only return a specific value when its parameter is bigger than 5000. In any other case, it will implicitly return undefined.

This behaviour may not be what you had intended. In any case, you can add a return undefined to the other execution path to make the return value explicit.

Loading history...
Unused Code introduced by
The parameter e is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
Bug introduced by
The variable mmex seems to be never declared. If this is a global, consider adding a /** global: mmex */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Unused Code Best Practice introduced by
The object created with new kendo.ui.NumericText... NumberLiteralNode(2)}) is not used but discarded. Consider invoking another function instead of a constructor if you are doing this purely for side effects.
Loading history...
Bug introduced by
The variable kendo seems to be never declared. If this is a global, consider adding a /** global: kendo */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Bug introduced by
The variable Lang seems to be never declared. If this is a global, consider adding a /** global: Lang */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Unused Code introduced by
The parameter o is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
Bug introduced by
The variable _ seems to be never declared. If this is a global, consider adding a /** global: _ */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Comprehensibility introduced by
Usage of the sequence operator is discouraged, since it may lead to obfuscated code.

The sequence or comma operator allows the inclusion of multiple expressions where only is permitted. The result of the sequence is the value of the last expression.

This operator is most often used in for statements.

Used in another places it can make code hard to read, especially when people do not realize it even exists as a seperate operator.

This check looks for usage of the sequence operator in locations where it is not necessary and could be replaced by a series of expressions or statements.

var a,b,c;

a = 1, b = 1,  c= 3;

could just as well be written as:

var a,b,c;

a = 1;
b = 1;
c = 3;

To learn more about the sequence operator, please refer to the MDN.

Loading history...
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...