Showing 1,191 of 2,112 total issues
Function render
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
render () {
const data = this.props.material;
return (
<div className="mb-material">
<div className="mb-material-thumbnail">
- 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 handleSubmit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
handleSubmit (e: any) {
e.preventDefault();
let { formState, classWord } = this.state;
- 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 componentDidMount
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
componentDidMount () {
const isAssignWrapped = window.self !== window.top && window.self.location.hostname === window.top?.location.hostname;
if (isAssignWrapped) {
const iframe = window.parent.document.getElementById("collectionIframe");
if (iframe) {
- 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 handleOuterClick
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
handleOuterClick (e: any) {
let el = e.target;
const container = this.containerRef.current;
if (container && this.state.showSuggestions) {
while (el && (el !== container)) {
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
render () {
const { material } = this.props;
return (
<span className="material_header">
<span className="material_meta_data">
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
render () {
const { currentTeachers } = this.state;
const { portalClass, portalClassTeacher, schools, portalClassGrades, enableGradeLevels, activeGrades, cancelLink, errors, teachers } = this.props;
const creating = !portalClass.id;
const updating = !creating;
- 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 renderMaterialUsage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
renderMaterialUsage () {
const classCount = this.props.material.class_count;
if (classCount != null) {
const usage = classCount === 0
? "Not used in any class."
- 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 _getColumns
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_getColumns () {
const columns: any = [];
// Adds all elements of `array` to column `columnIdx` and marks them as `visible`.
// Note that the array is @params.materials at the beginning and then its child elements recursively.
const fillColumns = (array: any, columnIdx?: any, visible?: any) => {
- 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 getQueryParams
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getQueryParams () {
const params: any = { remove_cc_teachers: this.state.removeCCTeachers, project_id: this.props.projectId };
for (const filter of ["teachers", "cohorts", "runnables"]) {
if ((this.state[filter] != null ? this.state[filter].length : undefined) > 0) {
params[filter] = this.state[filter].map((v: any) => v.value).sort().join(",");
- 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 onUserTypeSelect
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
onUserTypeSelect (data: any) {
let newUrl = window.location.protocol + "//" + window.location.host + window.location.pathname;
let queryString = "?";
if (window.location.search) {
- 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 search
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
search (incremental: any) {
const displayLimit = incremental ? this.state.displayLimit + DISPLAY_LIMIT_INCREMENT : DISPLAY_LIMIT_INCREMENT;
// short circuit further incremental searches when all data has been downloaded
if (incremental && (this.state.lastSearchResultCount === 0)) {
- 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"