Showing 1,205 of 1,252 total issues
Method generate_package
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def generate_package(old_attachment)
return nil if @test_params.blank?
@tmp_dir = Dir.mktmpdir
@old_meta = old_attachment.present? ? extract_meta(old_attachment, nil) : nil
- Read upRead up
- Create a ticketCreate a ticket
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 update
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def update
# We received a message from client, so time is updated regardless of how event records turn out
if params[:is_old_session]
@session.update!(last_video_time: update_params[:last_video_time])
else
- Read upRead up
- Create a ticketCreate a ticket
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
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def create
result = @annotation.class.transaction do
@post.title = @assessment.title
raise ActiveRecord::Rollback unless @post.save && create_topic_subscription && update_topic_pending_status
- Read upRead up
- Create a ticketCreate a ticket
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 AnnouncementCard
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const AnnouncementCard: FC<Props> = (props) => {
const {
intl,
announcement,
showEditOptions,
- Read upRead up
- Create a ticketCreate a ticket
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 ForumTopicManagementButtons
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const ForumTopicManagementButtons: FC<Props> = (props) => {
const { topic, pageType, disabled, showOnHover } = props;
const dispatch = useAppDispatch();
const { t } = useTranslation();
const navigate = useNavigate();
- Read upRead up
- Create a ticketCreate a ticket
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 AchievementAwardManager
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const AchievementAwardManager: FC<Props> = (props) => {
const { achievement, isLoading, handleClose, intl, setIsDirty } = props;
const achievementUsers = achievement.achievementUsers;
const [openConfirmation, setOpenConfirmation] = useState(false);
- Read upRead up
- Create a ticketCreate a ticket
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 ForumTopicPostManagementButtons
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const ForumTopicPostManagementButtons: FC<Props> = (props) => {
const { post, topicId, handleEdit, handleReply, isEditing, disabled } = props;
const dispatch = useAppDispatch();
const { t } = useTranslation();
const navigate = useNavigate();
- Read upRead up
- Create a ticketCreate a ticket
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 TimeBar
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const TimeBar = (props: TimeBarProps): JSX.Element => {
const [{ start, bonus, end }, setTime] = useState<TimeTriplet>(
generateTriplet(props.startsAt, props.bonusEndsAt, props.endsAt),
);
- Read upRead up
- Create a ticketCreate a ticket
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 UserInvitationsTable
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const UserInvitationsTable: FC<Props> = (props) => {
const {
title,
invitations,
pendingInvitations = false,
- Read upRead up
- Create a ticketCreate a ticket
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 DataFileRow
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const DataFileRow = (props: DataFileRowProps): JSX.Element => {
const file = unwrap(props.of);
const toBeDeleted = isMarked(props.of);
const handleClickDelete = (): void => {
- Read upRead up
- Create a ticketCreate a ticket
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 AssessmentDetails
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const AssessmentDetails = (props: AssessmentDetailsProps): JSX.Element => {
const { for: assessment } = props;
const { t } = useTranslation();
return (
- Read upRead up
- Create a ticketCreate a ticket
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 QuestionContent
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const QuestionContent: FC<Props> = (props) => {
const { handleNext, stepIndex } = props;
const assessment = useAppSelector(getAssessment);
const submission = useAppSelector(getSubmission);
- Read upRead up
- Create a ticketCreate a ticket
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 LiveFeedbackStatisticsTable
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const LiveFeedbackStatisticsTable: FC<Props> = (props) => {
const { t } = useTranslation();
const { courseId } = useParams();
const { includePhantom, liveFeedbackStatistics } = props;
- Read upRead up
- Create a ticketCreate a ticket
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 SkillManagementButtons
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const SkillManagementButtons: FC<Props> = (props) => {
const {
id,
canUpdate,
canDestroy,
- Read upRead up
- Create a ticketCreate a ticket
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 EmailsList
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const EmailsList = (props: EmailCardProps): JSX.Element => {
const { t } = useTranslation();
const [emailToRemove, setEmailToRemove] = useState<EmailData>();
const removeEmail = (email: EmailData): void => {
- Read upRead up
- Create a ticketCreate a ticket
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 renderEmailSettingsTable
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderEmailSettingsTable() {
const { userEmailSubscriptions } = this.props;
if (userEmailSubscriptions.length === 0) {
return (
- Create a ticketCreate a ticket
Function renderFolderTree
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderFolderTree(folder, indentLevel) {
const { selectedItems, targetRootFolder } = this.props;
const checked = !!selectedItems[FOLDER][folder.id];
// Children will be duplicated under the target course root folder if current folder is not checked
const childrenIndentLevel = checked ? indentLevel + 1 : ROOT_CHILDREN_LEVEL;
- Create a ticketCreate a ticket
Function renderRow
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderRow(achievement) {
const { dispatch, selectedItems } = this.props;
const checked =
!!selectedItems[duplicableItemTypes.ACHIEVEMENT][achievement.id];
const label = (
- Create a ticketCreate a ticket
Function renderBody
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderBody = () => {
if (isLoading) {
return <LoadingIndicator />;
}
- Create a ticketCreate a ticket
Function renderSubmissionInfo
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderSubmissionInfo() {
const { response } = this.props;
return (
<Table style={styles.submissionInfoTable}>
<TableBody>
- Create a ticketCreate a ticket