Showing 58 of 120 total issues
File state_view_mixin.py
has 581 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright © 2016, Ugo Pozo
# 2016, Câmara Municipal de São Paulo
# state_view_mixin.py - a mixin for views that perform searches.
File record_list.js
has 507 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright © 2016, Ugo Pozo
// 2016, Câmara Municipal de São Paulo
// record_list.js - component for listing records that match a search.
File app.js
has 461 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright © 2016, Ugo Pozo
// 2016, Câmara Municipal de São Paulo
// app.js - main component of the search interface.
StateViewMixin
has 41 functions (exceeds 20 allowed). Consider refactoring. Open
class StateViewMixin:
"""A mixin that performs a search and adds the result to the view context.
This mixin reads from a supposedly pre-filled :attr:`kwargs` attribute,
performs a search on the database based on the supplied configuration and
Function renderAction
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderAction() {
const open = !!this.props.currentAction;
let actionData = I.fromJS({});
File editor_token.js
has 359 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright © 2016, Ugo Pozo
// 2016, Câmara Municipal de São Paulo
// editor_token.js - token with the editing capabilities for the TokenField.
Function render
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let contents = (
<div style={{textAlign: "center"}}>
<CircularProgress
size={80}
Function render
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let style = Object.assign({}, this.props.style, {
height: 24,
padding: 8,
marginBottom: 12,
Function get_application_data
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def get_application_data(self):
react_search_route = "{}/{}{}{}{}".format(
self.search_slug,
":model/" if self.is_multi_modeled else "",
":page/" if self.is_paginated else "",
- 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 getSortingMenu
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
getSortingMenu() {
if (!this.props.sorting.get('available')) return null;
const available = this.props.sorting.getIn(['available',
this.props.modelName]);
Function renderError
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderError() {
let error = this.props.globalError;
const showErrorDialog = !!error && this.props.showErrorDetails;
const showErrorSnackbar = !!error && !this.props.showErrorDetails;
Function renderUserInfo
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderUserInfo() {
let userShow;
const firstName = this.props.user.get('first_name', "");
Function render
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let title = "Carregando...";
let contents = (
<div style={{textAlign: "center"}}>
File app_view_mixin.py
has 271 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright © 2016, Ugo Pozo
# 2016, Câmara Municipal de São Paulo
# app_view_mixin.py - mixin for providing a view for the basic search interface.
File token_list.js
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright © 2016, Ugo Pozo
// 2016, Câmara Municipal de São Paulo
// token_list.js - a list of tokens in a TokenField.
Function render
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let navHeader;
if (I.is(this.props.user, I.Map())) {
navHeader = this.renderLogin();
Function render
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const styles = this.state.tokens.map(token => ({
key: `token_${token.props.id}`,
data: token,
style: {
File unit_token.js
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright © 2016, Ugo Pozo
// 2016, Câmara Municipal de São Paulo
// unit_token.js - token representing a unit search.
Function get_templates
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def get_templates(self):
from django.template.loader import get_template
def render(template):
return get_template("{}.js".format(template)).render()
- 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 perform_actions
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def perform_actions(self):
action_name = self.request.POST.get('action_name', None)
action = self.actions.get(action_name, None)
self.action_result = {
- 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"