Showing 12,811 of 12,811 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
<a
href={`https://maps.google.com?saddr=${
query?.context?.location
}&daddr=${address}`}
tabIndex="0"
- 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 147.
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
"zones": [
"Africa/Abidjan|GMT|0|0||48e5",
"Africa/Nairobi|EAT|-30|0||47e5",
"Africa/Algiers|CET|-10|0||26e5",
"Africa/Lagos|WAT|-10|0||17e6",
- 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 147.
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
<a
href={`https://maps.google.com?saddr=${
query?.context?.location
}&daddr=${address}`}
tabIndex="0"
- 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 147.
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
zones: [
'Africa/Abidjan|GMT|0|0||48e5',
'Africa/Nairobi|EAT|-30|0||47e5',
'Africa/Algiers|CET|-10|0||26e5',
'Africa/Lagos|WAT|-10|0||17e6',
- 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 147.
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 resolveParamsWithUrl
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
export const resolveParamsWithUrl = ({
address,
locationType,
serviceType,
page,
- 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 EvidencePrivateRecords
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
const EvidencePrivateRecords = ({
data,
goBack,
goForward,
goToPath,
- 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 EvidenceVaRecords
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
const EvidenceVaRecords = ({
data,
goBack,
goForward,
goToPath,
- 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 EvidencePrivateRecords
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
const EvidencePrivateRecords = ({
data,
goBack,
goForward,
goToPath,
- 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 ApplicantAddressCopyPage
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
export function ApplicantAddressCopyPage({
contentBeforeButtons,
contentAfterButtons,
data,
setFormData,
- 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 DependentAges
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
const DependentAges = ({
contentBeforeButtons,
contentAfterButtons,
goForward,
goToPath,
- 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 ChangeOfAddressWrapper
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
const ChangeOfAddressWrapper = ({ mailingAddress, applicantName }) => {
const { loading: isLoading, error, data: response } = useSelector(
state => state.updateAddress,
);
const {
- 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 index.js
has 399 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Node modules.
import React from 'react';
import PropTypes from 'prop-types';
import { CONTACTS } from '@department-of-veterans-affairs/component-library/contacts';
// Relative imports.
File IntroductionPage.jsx
has 399 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
VaAlert,
VaButton,
VaSearchInput,
} from '@department-of-veterans-affairs/component-library/dist/react-bindings';
File helpers.jsx
has 399 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable camelcase */
import React from 'react';
import EbenefitsLink from 'platform/site-wide/ebenefits/containers/EbenefitsLink';
import { apiRequest as commonApiClient } from '@department-of-veterans-affairs/platform-utilities/api';
Function render
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { supplies, order, eligibility } = this.props;
const currentDate = moment();
const accessorySupplies = supplies.filter(
supply => supply.productGroup === ACCESSORY,
Function UpcomingAppointmentsPage
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
const UpcomingAppointmentsPage = props => {
const { router } = props;
const [refresh, setRefresh] = useState(false);
const selectApp = useMemo(makeSelectApp, []);
const { app } = useSelector(selectApp);
Function ThreadListItem
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ThreadListItem = props => {
const location = useLocation();
const { keyword, activeFolder } = props;
const {
senderName,
Function DeleteDraft
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DeleteDraft = props => {
const history = useHistory();
const location = useLocation();
const dispatch = useDispatch();
const deleteDraftButtonRef = useRef();
Function submitFilesLighthouse
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function submitFilesLighthouse(claimId, trackedItem, files) {
let filesComplete = 0;
let bytesComplete = 0;
let hasError = false;
const totalSize = files.reduce((sum, file) => sum + file.file.size, 0);
Function editPhoneNumberSuccess
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const editPhoneNumberSuccess = () => {
// store the phone number that's passed in via the POST or PUT call so we can
// return it with the GET user/ response
let newAreaCode;
let newPhoneNumber;