Showing 37 of 70 total issues
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
return (
<div className="week-nav">
<button
Function renderSemesterSelector
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderSemesterSelector () {
const name = semesterName(CP.translate.bind(CP), this.props.semester) ||
CP.translate('weekNav.unknown_semester')
const viewMoment = this.viewDateMoment()
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const icalUrl = this.getIcalUrl()
return (
<div className="function SidebarIcal" ref="rootEl">
<div className="clearfix" />
Function fetchUserCallback
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function fetchUserCallback (cb) {
function requestHandler (request) {
if (request.readyState === XMLHttpRequest.DONE) {
if (request.status === 200) {
// Request successful
- 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 eventExceptions
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
eventExceptions () {
const { appliedExceptions } = this.props.data.details
if (appliedExceptions && appliedExceptions.length > 0) {
const exceptionDesc = this.props.data.cancelled ? 'detail.cancelled' : 'detail.modified'
Function invertLinkNames
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function invertLinkNames (linksNames) {
const ret = {
cs: { courses: {}, teachers: {}, exceptions: {} },
en: { courses: {}, teachers: {}, exceptions: {} },
}
Function eventBasicProps
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
eventBasicProps () {
const { data } = this.props
const seqNumber = data.sequenceNumber || '?'
const nameButton = (
Function renderMonthSelector
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderMonthSelector () {
const viewMoment = this.viewDateMoment()
return (
Function invertLinkNames
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function invertLinkNames (linksNames) {
const ret = {
cs: { courses: {}, teachers: {}, exceptions: {} },
en: { courses: {}, teachers: {}, exceptions: {} },
}
- 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 deeply nested control flow statements. Open
for (let i = 0; i < ajaxresult.linked.teachers.length; i++) {
// Add teacher link full name
linknames.teachers.push({
id: ajaxresult.linked.teachers[i].id,
name: {
Avoid deeply nested control flow statements. Open
for (let i = 0; i < ajaxresult.linked.courses.length; i++) {
// Add course link full name
linknames.courses.push({
id: ajaxresult.linked.courses[i].id,
name: {
Function calculateOverlap
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function calculateOverlap (events) {
let lastend = moment(0)
const sortByStart = ({startsAt: lhs}, {startsAt: rhs}) => {
const lhsD = moment(lhs)
- 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 deeply nested control flow statements. Open
for (let i = 0; i < ajaxresult.linked.schedule_exceptions.length; i++) {
// Add exceptions link full name
linknames.exceptions.push({
id: ajaxresult.linked.schedule_exceptions[i].id,
type: ajaxresult.linked.schedule_exceptions[i].exception_type,
Function semesterDataCallback
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function semesterDataCallback (callback) {
function requestHandler (request) {
if (request.readyState === XMLHttpRequest.DONE) {
// Request successful
- 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 NowIndicator
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function NowIndicator ({
currentDate, timeline, viewDate, days7, screenSize, horizontalLayout }) {
const now = moment(currentDate)
- 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 searchCallback
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function searchCallback (query, callback) {
function requestHandler (request) {
if (request.readyState === XMLHttpRequest.DONE) {
if (request.status === 200) {
// Request successful
- 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 viewDate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
viewDate () {
const rangeFun = this.props.days7 ? weekRange : workWeekRange
// FIXME: remove moment dependency
const [weekStart, weekEnd] = rangeFun(this.props.viewDate).map(d => moment(d))
- 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"