Function groupPrivacy
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export var groupPrivacy = function(group, privacy) {
privacy = privacy || group.groupPrivacy;
if (group.isParent()) {
switch (privacy) {
- 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 groupPrivacyConfirm
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export var groupPrivacyConfirm = function(group) {
if (group.isNew()) { return ""; }
if (group.attributeIsModified('groupPrivacy')) {
if (group.privacyIsSecret()) {
- 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 groupPrivacy
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export var groupPrivacy = function(group, privacy) {
privacy = privacy || group.groupPrivacy;
if (group.isParent()) {
switch (privacy) {
Function eventTitle
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export var eventTitle = function(event) {
switch (event.eventableType) {
case 'Comment': return event.model().parentAuthorName;
case 'Poll': case 'Outcome': return event.model().poll().title;
case 'Group': case 'Membership': return event.model().group().name;
- 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 groupPrivacyStatement
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export var groupPrivacyStatement = function(group) {
if (group.parentId && group.parent().privacyIsSecret()) {
if (group.privacyIsClosed()) {
return 'group_form.privacy_statement.private_to_parent_members';
} else {
- 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
Avoid too many return
statements within this function. Open
return 'discussion_edited';
Avoid too many return
statements within this function. Open
return 'group_form.confirm_change_to_private_discussions_only';
Avoid too many return
statements within this function. Open
return 'group_form.subgroup_privacy_is_closed_description';