Showing 570 of 1,380 total issues
Function oninit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
oninit(vnode) {
h.scrollTop();
const currentUser = h.getUser() || {};
const hasFBAuth = currentUser.has_fb_auth;
- 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 getCurrentProject
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const getCurrentProject = () => {
const root = document.getElementById('application');
const data = root && root.getAttribute('data-parameters');
if (data) {
- 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 oninit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
oninit({ attrs: { goalDetails: goalsDetails, subscriptionData }, state } : m.Vnode<ProjectGoalsBoxAttrs, ProjectGoalsBoxState>) {
const currentGoalIndex = prop(0)
const getCurrentGoalIndex = (goalsDetails : GoalDetails[], {amount_paid_for_valid_period} : {amount_paid_for_valid_period : number}) => {
if (goalsDetails.length > 0) {
const index = _.findIndex(goalsDetails, goal => goal.value > amount_paid_for_valid_period)
- 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 closeModal
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
closeModal = () => {
// Temp for rails unstyled close links
const close = (elm, selector) => {
const all = document.getElementsByClassName(selector);
let cur = elm.parentNode;
- 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 mountQuery
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private mountQuery() {
const query : Query = { }
if (this._mode !== 'all_modes') {
- 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 createDomFromListOrString
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
jasmine.reporting.StyledHtmlReporter.prototype.createDomFromListOrString = function(data, tags) {
var classAttrs = '';
if (typeof tags !== 'undefined') {
classAttrs = (tags instanceof Array) ? tags.join(' ') : tags;
}
- 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 createBasicPaginationVMWithAutoRedraw
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
createBasicPaginationVMWithAutoRedraw = vmInstance => {
const error = prop(false);
const errorMessage = prop('');
return {
- 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 saveFields
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private async saveFields(fields : string[], requiredFields : string[]) {
this._isSavingProject = true
h.redraw()
- 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 generateFormatNumber
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
generateFormatNumber = (s, c) => (number, n, x) => {
if (!_.isNumber(number)) {
return null;
}
- 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 WhenChangeNationality
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function WhenChangeNationality(user : UserDetails, states: prop<State[]>) : UserAddress {
const defaultCountryID = 36 // Brasil
const isInternational = Number(user.address.country_id) !== defaultCountryID
if (!_.isEmpty(states()) && !isInternational) {
- 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"