Showing 199 of 199 total issues
File problem.py
has 718 lines of code (exceeds 250 allowed). Consider refactoring. Open
import asyncio
import functools
import io
import os.path
import zipfile
Function default
has 203 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (env = {}) {
function eslintLoader() {
return {
loader: 'eslint-loader',
options: {
File builtin.py
has 498 lines of code (exceeds 250 allowed). Consider refactoring. Open
import collections
import datetime
import functools
import itertools
File contest.py
has 491 lines of code (exceeds 250 allowed). Consider refactoring. Open
import asyncio
import collections
import datetime
import functools
import itertools
Function buildBodyData
has 179 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildBodyData() {
const now = moment();
const days = [];
{
// back fill
File base.py
has 424 lines of code (exceeds 250 allowed). Consider refactoring. Open
import accept
import asyncio
import calendar
import functools
import hmac
File homework.py
has 394 lines of code (exceeds 250 allowed). Consider refactoring. Open
import asyncio
import collections
import datetime
import io
import pytz
Function page
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
const page = new NamedPage('domain_manage_user', () => {
const addUserSelector = UserSelectAutoComplete.getOrConstruct($('.dialog__body--add-user [name="user"]'));
const addUserDialog = new ActionDialog({
$body: $('.dialog__body--add-user > div'),
onDispatch(action) {
File document.py
has 373 lines of code (exceeds 250 allowed). Consider refactoring. Open
import itertools
from bson import objectid
from pymongo import ReturnDocument
from vj4 import db
Similar blocks of code found in 2 locations. Consider refactoring. Open
async function handleSectionCollapse(ev) {
const $section = $(ev.currentTarget).closest('.training__section');
if ($section.is('.collapsed, .animating')) {
return;
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 131.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
async function handleSectionExpand(ev) {
const $section = $(ev.currentTarget).closest('.training__section');
if ($section.is('.expanded, .animating')) {
return;
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 131.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function page
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
const page = new NamedPage('domain_manage_user', () => {
const addUserSelector = UserSelectAutoComplete.getOrConstruct($('.dialog__body--add-user [name="user"]'));
const addUserDialog = new ActionDialog({
$body: $('.dialog__body--add-user > div'),
onDispatch(action) {
- 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
File contest.py
has 345 lines of code (exceeds 250 allowed). Consider refactoring. Open
import asyncio
import calendar
import datetime
import io
import pytz
File index.js
has 338 lines of code (exceeds 250 allowed). Consider refactoring. Open
import _ from 'lodash';
import moment from 'moment';
import tpl from 'vj/utils/tpl';
export default class Calendar {
Function invoke_by_args
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def invoke_by_args():
import argparse
import asyncio
import coloredlogs
import inspect
- 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
File discussion.py
has 328 lines of code (exceeds 250 allowed). Consider refactoring. Open
import asyncio
import functools
from bson import objectid
from vj4 import app
Function main
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def main():
if not options.syslog:
coloredlogs.install(level=logging.DEBUG if options.debug else logging.INFO,
fmt='[%(levelname).1s %(asctime)s %(module)s:%(lineno)d] %(message)s',
datefmt='%y%m%d %H:%M:%S')
- 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
File domain.py
has 318 lines of code (exceeds 250 allowed). Consider refactoring. Open
import asyncio
import collections
import datetime
import functools
Function layout
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
.map(banners => {
const dayBitmap = _
.fill(new Array(7), 1)
.map(() => []);
banners.forEach(banner => {
Similar blocks of code found in 2 locations. Consider refactoring. Open
<ToolbarButton
activated={this.props.pretestVisible}
onClick={() => this.props.togglePanel('pretest')}
data-global-hotkey="alt+p"
data-tooltip={`${i18n('Toggle Pretest Panel')} (Alt+P)`}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 99.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76