Showing 462 of 1,666 total issues
Function link_open
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
md.renderer.rules.link_open = function (tokens, idx, options, env, self) {
Function requestNewAccount
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
async requestNewAccount(passcode, courseSlug, username, email, createAccountNow) {
Function setValidation
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
const setValidation = function (key, valid, message, changed = true, state) {
Function defaultRender
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
const defaultRender = md.renderer.rules.link_open || function (tokens, idx, options, env, self) {
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(current, past, submitted, strictly_current, current_user)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(course, title, talk_title, assignments, templates)
Method email
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def email(course, staffer, adder, new_instructor, courses_user)
Function notifications
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function notifications(state = initialState, action) {
switch (action.type) {
case ADD_NOTIFICATION: {
const newState = [...state, action.notification];
- 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 handleParentConditionalChange
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
handleParentConditionalChange(value, conditionalGroup, $parent) {
let { currentAnswers } = conditionalGroup;
let conditional;
// let resetQuestions = false;
- 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 users
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function users(state = initialState, action) {
switch (action.type) {
case RECEIVE_USERS: {
// Transform the 'real_name' for users in 'action' into separate 'first_name'
// and 'last_name' properties if 'real_name' is available by using transformUsers.
- 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 validateCurrentQuestion
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
validateCurrentQuestion(e) {
e.preventDefault();
const $target = $(e.target);
const $block = $target.parents('.block');
this.$currentBlock = $block;
- 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 PaginatedArticleControls
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const PaginatedArticleControls = ({ showMore, limitReached }) => {
const dispatch = useDispatch();
const handlePageChange = ({ selected }) => {
dispatch({ type: SET_ARTICLES_PAGE, page: selected + 1 });
- 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 ModuleStatus
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const ModuleStatus = ({
block_id, course, deadline_status, due_date, flags, kind, module_progress, progressClass, slug,
complete, fetchExercises, incomplete
}) => {
const isTrainingModule = kind === TRAINING_MODULE_KIND;
- 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 render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
render() {
const panelCount = this.props.panels.length;
const panels = this.props.panels.map((panel, i) => {
const active = this.props.activePanelIndex === i;
const stepNumber = i + 1;
- 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 Alert
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const Alert = ({ alert, adminAlert, resolveAlert }) => {
let resolveCell;
let alertTypeCell;
if (adminAlert) {
- 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 CampaignOresPlot
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const CampaignOresPlot = (props) => {
const [show, setShow] = useState(false);
const [loading, setLoading] = useState(true);
const [filePath, setFilePath] = useState(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
Method validate_date_attribute
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def validate_date_attribute(date_type)
value = send("#{date_type}_before_type_cast")
self[date_type] = value.is_a?(Date) || value.is_a?(Time) ? value : Time.zone.parse(value)
if self[date_type].nil?
errors.add(date_type, I18n.t('error.invalid_date', key: date_type.capitalize))
- 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
Method create_alerts_for_active_courses
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create_alerts_for_active_courses
@courses.each do |course|
next unless nontrivial_mainspace_activity?(course)
next if Alert.exists?(course_id: course.id, type: 'SandboxedCourseMainspaceAlert')
alert = Alert.create(type: 'SandboxedCourseMainspaceAlert',
- 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 TagEditable
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const TagEditable = ({ course_id }) => {
const availableTags = useSelector(state => getAvailableTags(state));
const tags = useSelector(state => state.tags.tags);
const dispatch = useDispatch();
- 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 TicketsHandler
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const TicketsHandler = () => {
const [page, setPage] = useState(0);
const [mode, setMode] = useState('filter');
const [searchQuery, setSearchQuery] = useState({ by_email_or_username: '', in_subject: '', in_content: '', by_course: '', });
- 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"