Showing 126 of 199 total issues
Function render
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<Panel
title={(
<span>
Function load
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function load() {
const loadSequence = [
...buildSequence(includedPages, 'before'),
...buildSequence([currentPage], 'before'),
...buildSequence(includedPages, 'after'),
Function _assignment_stat
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def _assignment_stat(tdoc, journal):
effective = {}
for j in journal:
if j['pid'] in tdoc['pids'] and not (j['pid'] in effective and effective[j['pid']]['accept']):
effective[j['pid']] = j
- 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 printLiteralOrObject
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function printLiteralOrObject(v) {
if (typeof v === 'number') {
print(String(v));
return;
}
Function smoothScrollPage
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
const smoothScrollPage = new AutoloadPage('smoothScrollPage', null, () => {
const HISTORY_SUPPORT = !!(typeof window.history === 'object' && window.history.pushState);
const ANCHOR_REGEX = /^#[^ ]+$/;
const OFFSET_HEIGHT = 10 + ($('.nav').height() || 0);
Function attach
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
attach() {
if (this.attached) {
return false;
}
Function updateSelection
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function updateSelection(sendRequest = true) {
dirtyCategories.forEach(({ type, category, subcategory }) => {
let item = categories[category];
const isSelected = item.select || _.some(item.children, c => c.select);
setDomSelected(item.$tag, isSelected);
Function _show
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
async _show() {
this.$dom.css('z-index', zIndexManager.getNext());
this.$dom.trigger('vjDomDialogShow');
this.isAnimating = true;
Function __await__
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def __await__(self):
try:
self.response = web.Response()
yield from HandlerBase.prepare(self).__await__()
yield from super(Handler, self).__await__()
- 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 constructor
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(events) {
this.$dom = $(tpl`
<div class="calendar">
<div class="calendar__header">
<button name="prev"><span class="icon icon-chevron_left"></span></button>
Function apply
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
apply(compiler) {
compiler.plugin('emit', (compilation, callback) => {
const stats = compilation.getStats().toJson();
const manifest = _(stats.assets)
.map((asset) => {
Function render
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const orderedDialogues = _.orderBy(
_.values(this.props.dialogues),
dialogue => (dialogue.isPlaceholder
? Number.POSITIVE_INFINITY
Function navigationPage
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const navigationPage = new AutoloadPage('navigationPage', () => {
if (!document.getElementById('panel') || !document.getElementById('menu')) {
return;
}
if ($nav.length > 0
Function generateConstants
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function generateConstants() {
let lastFile = null;
const packages = [];
Function default
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default function ({ watch, production }) {
const compiler = webpack(webpackConfig({ watch, production }));
const outputOptions = {
- 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 build_query
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def build_query(query_string):
category_groups = ProblemCategoryHandler.my_split(query_string, ' ')
if not category_groups:
return {}
query = {'$or': []}
- 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 paginate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def paginate(page, num_pages):
radius = 2
if page > 1:
yield 'first', 1
yield 'previous', page - 1
- 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 constructor
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor($dom, options = {}) {
super($dom);
this.options = {
items: async () => [],
render: () => '',
Function signinDialogPage
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const signinDialogPage = new AutoloadPage('signinDialogPage', null, () => {
const signInDialog = DomDialog.getOrConstruct($('.dialog--signin'), {
cancelByClickingBack: true,
cancelByEsc: true,
});
Function updateBody
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
async updateBody(direction) {
this.animating = true;
const $newBody = this.buildBody();
$newBody.appendTo(this.$dom.find('.calendar__body-container'));
if (this.$lastBody !== null) {