Showing 1,205 of 1,252 total issues
Function InviteUsersRegistrationCode
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const InviteUsersRegistrationCode: FC<Props> = (props) => {
const { open, handleClose, intl } = props;
const [isLoading, setIsLoading] = useState(false);
const registrationCode = useAppSelector(getCourseRegistrationKey);
- Create a ticketCreate a ticket
Function CourseShow
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const CourseShow: FC<Props> = (props) => {
const { intl } = props;
const [isLoading, setIsLoading] = useState(true);
const dispatch = useAppDispatch();
const { courseId } = useParams();
- Create a ticketCreate a ticket
Class Programming
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Course::Assessment::Question::Programming < ApplicationRecord # rubocop:disable Metrics/ClassLength
enum :package_type, { zip_upload: 0, online_editor: 1 }
# The table name for this model is singular.
self.table_name = table_name.singularize
- Create a ticketCreate a ticket
Function InvitationResultInvitationsTable
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const InvitationResultInvitationsTable: FC<Props> = (props) => {
const { title, invitations, intl } = props;
const options: TableOptions = {
download: true,
- Create a ticketCreate a ticket
Function ResponseForm
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ResponseForm = (props) => {
const {
initialValues,
onSubmit,
readOnly,
- Create a ticketCreate a ticket
Function AssessmentStatisticsPage
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AssessmentStatisticsPage: FC = () => {
const { t } = useTranslation();
const [tabValue, setTabValue] = useState('marksPerQuestion');
const [includePhantom, setIncludePhantom] = useState(false);
- Create a ticketCreate a ticket
Function ResponseIndex
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
Open
const ResponseIndex = (props) => {
const { dispatch, survey, responses, isLoading } = props;
const { palette } = useTheme();
const { NOT_STARTED, RESPONDING, SUBMITTED } = responseStatus;
const dataColor = {
- 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 customFooter
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
customFooter: () => {
return (
<TableFooter>
<TableRow>
<TableCell
- Create a ticketCreate a ticket
Function ForumShow
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ForumShow: FC = () => {
const { t } = useTranslation();
const { forumId } = useParams();
// Need to get the forum Id number below as sometimes, the forumId in the URL is in the form of slug.
// The forum id number is required to to select the entity from the redux store.
- Create a ticketCreate a ticket
Function DurationBar
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const DurationBar = (props: DurationBarProps): JSX.Element => {
const start = moment(props.starts).startOf('day');
const bonus = props.bonusEnds && moment(props.bonusEnds).startOf('day');
const end = props.ends && moment(props.ends).startOf('day');
- Create a ticketCreate a ticket
Function TableMaterialRow
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const TableMaterialRow: FC<Props> = (props) => {
const { currFolderId, material, isCurrentCourseStudent, isConcrete } = props;
return (
<TableRow id={`material-${material.id}`}>
- Create a ticketCreate a ticket
Function QuestionsManager
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const QuestionsManager = (props: QuestionsManagerProps): JSX.Element => {
const { t } = useTranslation();
const [questions, setQuestions] = useState(props.of);
const [submitting, setSubmitting] = useState(false);
const [currentDestination, setCurrentDestination] = useState<number>();
- Create a ticketCreate a ticket
Function ResendConfirmationEmailPage
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ResendConfirmationEmailPage = (): JSX.Element => {
const { t } = useTranslation();
const [email, setEmail] = useEmailFromAuthPagesContext();
- Create a ticketCreate a ticket
ScribingToolbar
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class ScribingToolbar extends Component {
constructor(props) {
super(props);
this.state = {
colorDropdowns: initializeColorDropdowns(),
- Create a ticketCreate a ticket
Class Course
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Course < ApplicationRecord
include Course::SearchConcern
include Course::DuplicationConcern
include Course::CourseComponentsConcern
include TimeZoneConcern
- Create a ticketCreate a ticket
Function LiveFeedbackToggleButton
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const LiveFeedbackToggleButton: FC<LiveFeedbackToggleButtonProps> = (props) => {
const { assessmentIds, for: title, hideChipIndicator } = props;
const { t } = useTranslation();
const dispatch = useAppDispatch();
- Create a ticketCreate a ticket
Function IndividualInvitation
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const IndividualInvitation: FC<Props> = (props) => {
const { permissions, fieldsConfig, index, intl } = props;
const renderInvitationBody = (
<Grid alignItems="center" container flexWrap="nowrap">
- Create a ticketCreate a ticket
Function default
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function (state = {}, action) {
switch (action.type) {
case actions.FETCH_SUBMISSION_SUCCESS:
case actions.UNSUBMIT_SUCCESS:
case actions.FINALISE_SUCCESS:
- Create a ticketCreate a ticket
Function UserVideoSubmissionsTable
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const UserVideoSubmissionsTable: FC<Props> = (props) => {
const { videoSubmissions, intl } = props;
if (!videoSubmissions || videoSubmissions.length === 0) {
return <Note message="This course has no video yet!" />;
- Create a ticketCreate a ticket
Function render
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
Open
render() {
const { scribing } = this.props;
const toolBarStyle = !scribing.isCanvasLoaded
? styles.disabledToolbar
: styles.toolBar;
- 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"