Showing 94 of 94 total issues
Function render
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { viewer } = this.props;
return (
<header>
Function plugins
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
plugins: (() => {
const plugins = [
new webpack.DefinePlugin({
'process.env': {
IS_BROWSER: true, // Because webpack is used only for browser code.
Function configureMiddleware
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function configureMiddleware(initialState, platformDeps, platformMiddleware) {
if (!firebaseDeps) {
// Lazy init.
firebase.initializeApp(initialState.config.firebase);
firebaseDeps = {
Function render
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { children, viewer } = this.props;
const { displayName, email, photoURL } = viewer;
return (
Function render
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { intl, onRouteChange, viewer } = this.props;
return (
<ScrollView
Function makeConfig
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export default function makeConfig(options) {
const {
isDevelopment
} = options;
- 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 configureStore
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function configureStore(options) {
const {
initialState,
platformDeps = {},
platformMiddleware = [],
Function render
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { currentLocale, locales, setCurrentLocale } = this.props;
return (
<CenteredView>
Function createArgs
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
createArgs(eventTypes = {}) {
// eventTypes.all is shorthand for all granular Firebase events.
if (eventTypes.all) {
// Make a shallow copy to prevent original eventTypes modifications.
eventTypes = { ...eventTypes };
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
// To remember beloved −123 min. https://www.youtube.com/watch?v=VKOv1I8zKso
const unreadCount = 123;
return (
Function queryFirebase
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default function queryFirebase(Wrapped, mapPropsToOptions) {
return class FirebaseQuery extends Component {
static contextTypes = {
store: PropTypes.object // Redux store.
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
try {
return await firebaseAuth().signInWithEmailAndPassword(email, password);
} catch (error) {
if (messages[error.code]) {
throw mapFirebaseErrorToEsteValidationError(error.code);
- 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 60.
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
try {
return await firebaseAuth().createUserWithEmailAndPassword(email, password);
} catch (error) {
if (messages[error.code]) {
throw mapFirebaseErrorToEsteValidationError(error.code);
- 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 60.
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
constructor() {
super();
this.onButtonClick = this.onButtonClick.bind(this);
this.onTitleClick = this.onTitleClick.bind(this);
}
- 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 60.
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
constructor() {
super();
this.onTextInputEndEditing = this.onTextInputEndEditing.bind(this);
this.onSubmitEditing = this.onSubmitEditing.bind(this);
}
- 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 60.
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 updateList
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default function updateList(
list,
ItemRecord,
idProp,
args
- 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 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { appCssFilename, bodyHtml, googleAnalyticsId, helmet, isProduction } = this.props;
const linkStyles = appCssFilename &&
<link
href={appCssFilename}
Function start
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function start(Wrapped) {
class Start extends Component {
static propTypes = {
intl: PropTypes.object.isRequired,
Function updateList
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function updateList(
list,
ItemRecord,
idProp,
args
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function render(req, res, next) {
const memoryHistory = createMemoryHistory(req.originalUrl);
const store = configureStore({
initialState: createRequestInitialState(req),
platformMiddleware: [routerMiddleware(memoryHistory)]