Showing 41 of 110 total issues
File index.js
has 563 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
ActivityIndicator,
Linking,
Platform,
Share,
Function render
has 199 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
navigateToAboutApp,
navigateToAboutFOIMaster,
navigateToFAQ,
Function render
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
filterChange,
currentUserId,
currentUserFilter,
Function render
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { clampedScroll } = this.state;
const headerTranslate = clampedScroll.interpolate({
inputRange: [0, LIST_HEADER_HEIGHT],
File FoiRequestsMasterScreen.js
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
Alert,
Animated,
FlatList,
Platform,
Function render
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { title, description, letterEnd, letterStart, anon } = this.state;
const { publicBody } = this.props.navigation.state.params;
const mainElements = (
Function render
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { filter, updateFilter } = this.props;
// special tab for public body, somehwat hacky
const publicBodyTab = filter.publicBody && (
Function search
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function search(state = initialState, action) {
switch (action.type) {
case 'SEARCH_FOI_REQUESTS_ERROR':
return {
...state,
Function render
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const cta = (
<View style={{ width: '97%' }}>
<Text style={styles.text}>
{`Sieh' dir die Anfragen von anderen Personen an oder erfahr' erst mehr über Informationsfreiheit in unserem kurzen Video.
Function foiRequests
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function foiRequests(state = initialState, action) {
switch (action.type) {
case 'FOI_REQUESTS_ERROR':
return {
...state,
Function buildUrl
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Open
function buildUrl(getState) {
const state = getState();
const { filter, nPage, isRefreshing, campaign } = state.foiRequests;
let offset = FOI_REQUESTS_PAGE_SIZE * nPage;
- 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 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
title,
description,
publicBody,
Function render
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
pastAlertMatches,
alerts,
hasNotificationPermission,
Function render
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { title, public_body: publicBody, description } = this.props.request;
let subheading = (
<SubHeading style={styles.subheading}>
{I18n.t('foiRequestDetails.notYetSpecified')}
File ProfileStartScreen.js
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Linking, Platform } from 'react-native';
import { ListItem } from 'react-native-elements';
import { NavigationActions } from 'react-navigation';
import { connect } from 'react-redux';
import React from 'react';
Function render
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const size = Platform.OS === 'ios' ? 35 : 26; // for icon
const { currentUserId, navigateToLogin } = this.props;
const { search } = this.state;
return (
Function authentication
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function authentication(state = initialState, action) {
switch (action.type) {
case 'OAUTH_UPDATE_TOKEN':
return {
...state,
Function buildUrl
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function buildUrl(getState) {
const state = getState();
const { filter, nPage, isRefreshing, campaign } = state.foiRequests;
let offset = FOI_REQUESTS_PAGE_SIZE * nPage;
Function render
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
render() {
const {
filterChange,
currentUserId,
currentUserFilter,
- 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 toggleFollow
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async toggleFollow() {
try {
const {
id,
getAccessToken,