Showing 462 of 1,666 total issues
Method unknown?
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def unknown?
!created_claim? &&
!changed_claim? &&
!removed_claim? &&
!added_alias? &&
Function ButtonNavigation
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ButtonNavigation = (props) => {
const dispatch = useDispatch();
const {
active, index, buttonLabel
Function onSubmit
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onSubmit = (e, status, kind) => {
e.preventDefault();
if (isBlank(replyDetails.plainText)) {
setReplyDetails(prevState => ({ ...prevState, sending: false }));
return;
Method to_question_params
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_question_params
{
:type => type,
:question_group => question_group,
:question_text => question_text,
Function userRoles
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
userRoles(currentUser, users) {
// Role values correspond to the CoursesUsers roles defined
const roles = {};
if (!currentUser) { return roles; }
if (getFiltered(users, { id: currentUser.id, role: STUDENT_ROLE })[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"
Further reading
Function findInView
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
findInView(name, paragraphs, length, scrollBox) {
const savedIndex = this.scrollObject[name].index - 1;
while (this.currentCoordinate !== null && this.isInView(scrollBox, this.currentCoordinate, this.nextPosition) === true) {
this.scrollObject[name].index += 1;
if (this.scrollObject[name].index >= length) {
- 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 getInitialState
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
getInitialState() {
// getting filters from the URL
const { wiki, newness, tracked } = parse(this.props.router.location.search);
// filter by "wiki"
- 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 EmptyWeek
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const EmptyWeek = ({
emptyTimeline,
edit_permissions,
usingCustomTitles,
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"
Further reading
Function StudentRevisionsList
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const StudentRevisionsList = ({ course, student, wikidataLabels, userRevisions }) => {
const dispatch = useDispatch();
const [isOpen, setIsOpen] = useState(false);
const [namespace, setNamespace] = useState('all');
- 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 AvailableArticle
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const AvailableArticle = ({ assignment, current_user, course, selectable }) => {
const dispatch = useDispatch();
const onSelectHandler = () => {
const assignmentObj = {
- 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 ArticleGraphs
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const ArticleGraphs = ({ article }) => {
const { id: article_id } = article;
const [showGraph, setShowGraph] = useState(false);
const [selectedRadio, setSelectedRadio] = useState('wp10_score');
- 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 ArticlesHandler
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const ArticlesHandler = (props) => {
const [loading, setLoading] = useState(true);
useEffect(() => {
delayFetchAssignmentsAndArticles(props, () => setLoading(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 CourseAlert
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const CourseAlert = (props) => {
let componentsElement = null;
let action = null;
if (props.components) componentsElement = props.components;
- 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 AvailableArticles
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const AvailableArticles = (props) => {
useEffect(() => {
const project = props.course.home_wiki.project;
document.title = `${props.course.title} - ${ArticleUtils.I18n('available', project)}`;
}, []);
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
render() {
if (!this.shouldShowDiff(this.props) || !this.props.revision) {
return (
<div className={`tooltip-trigger ${this.props.showButtonClass}`}>
<button onClick={this.showDiff} aria-label="Open Diff Viewer" className="icon icon-diff-viewer"/>
- 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 uploads
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function uploads(state = initialState, action) {
switch (action.type) {
case RECEIVE_UPLOADS: {
const dataUploads = action.data.course.uploads;
// Intial sorting by upload date
- 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 EditButton
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const EditButton = ({
allowMultipleArticles, current_user, is_open, setHover, open, role, student,
tooltip, tooltipIndicator, assignmentLength, project
}) => {
let assignText;
- 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 CampaignEditable
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const CampaignEditable = ({ course_id }) => {
const availableCampaigns = useSelector(state => getAvailableCampaigns(state));
const campaigns = useSelector(state => state.campaigns.campaigns);
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 render
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { course, current_user } = this.props;
if (course.cloned_status === 1 || course.cloned_status === 3) {
return (
- 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 set_articles_edited
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def set_articles_edited
@articles_edited = {}
@course.tracked_revisions.includes(:user, article: :wiki).each do |edit|
# Skip if the Article record is missing
next unless edit.article
- 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"