Showing 63 of 243 total issues
Function click
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
click: function(e) {
var sortField = this.get('controller.sortField');
var sortOrder = this.get('controller.sortOrder');
var allowSortByNone = this.get('controller.allowSortByNone');
var nextSortOrder = 'desc';
- Read upRead up
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 status_description
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
status_description: function() {
if (this.get('is_failed')) {
if (this.get('failure_reason') || this.get('failure_reason_code')) {
return this.get('failure_reason') || this.get('failure_reason_code');
}
- Read upRead up
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 formatFileSize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
formatFileSize: function(bytes) {
if (bytes >= 1000000000) {
bytes = (bytes / 1000000000).toFixed(2) + ' gb';
} else if (bytes >= 1000000) {
bytes = (bytes / 1000000).toFixed(2) + ' mb';
- Read upRead up
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"