Showing 12,833 of 12,833 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
OrdersBlock.propTypes = {
heading: PropTypes.string,
intro: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
orders: PropTypes.array,
type: PropTypes.object,
- 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 63.
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
function getUrl(lang) {
const url = new URL(window.location.href);
url.searchParams.set('lang', lang);
return `${url.pathname}${url.search}`;
}
- 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 63.
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
{distance && (
<div
id={`representative-${representativeId}`}
className="vads-u-font-weight--bold vads-u-font-family--serif"
>
- 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 63.
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
<p>
Or,{' '}
<button
type="button"
className="va-button-link"
- 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 63.
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
if (typeof nextAction === 'string') {
nextPage = pageFlow[nextAction];
nextStateKey = nextAction;
} else {
nextStateKey = await nextAction(getState(), dispatch);
- 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 63.
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
<div className="vads-u-flex--1">
<input
className="usa-input"
id="yr-search-name"
name="yr-search-name"
- 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 63.
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
<div data-testid="modal-content">
<p>
Your updated home address:
<span className="vads-u-font-weight--bold vads-u-display--block vads-u-margin-y--1p5">
<AddressView data={homeAddress} />
- 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 63.
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 render
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<div
className={`hidden-header vads-u-display--flex vads-u-align-items--center${
this.props.isHeaderV2 ? '' : ' vads-u-padding-top--1'
Function render
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const buttonClasses = classNames(
this.props.cssClass,
{ 'va-btn-withicon': this.props.icon },
'va-dropdown-trigger',
Function replaceSchema
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
replaceSchema: (formData, _schema, _uiSchema, index, path) => {
const addressPath = getAddressPath(path); // path is ['address', 'currentField']
cachedPath = addressPath;
const data = get(addressPath, formData) ?? {};
const { country } = data;
Function constructor
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(props) {
super(props);
// Throw an error if there’s no viewComponent (should be React component)
if (
Function fetchTotalDisabilityRating
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function fetchTotalDisabilityRating() {
const {
FETCH_TOTAL_RATING_STARTED,
FETCH_TOTAL_RATING_FAILED,
FETCH_TOTAL_RATING_SUCCEEDED,
Function mapStateToProps
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mapStateToProps = (state, ownProps) => {
const supplies = state.form?.data?.supplies;
const batterySupplies = supplies
?.filter(battery => battery.productGroup?.includes('Battery'))
.filter(battery => moment().diff(battery.nextAvailabilityDate) >= 0);
Function onSuccess
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onSuccess = resp => {
const successfulSubmissions = resp.filter(response =>
response.status.toLowerCase().includes('processed'),
);
const failedSubmissions = resp.filter(
Function data
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
data: (state = initialState, action) => {
switch (action.type) {
case MEB_FETCH_CLAIM_STATUS:
return {
...state,
Function submit
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function submit(form, formConfig) {
const headers = { 'Content-Type': 'application/json' };
const body = transform(formConfig, form);
const apiRequestOptions = {
method: 'POST',
Function applicantInformationField
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const applicantInformationField = (automatedTest = false) => {
if (isProductionOfTestProdEnv(automatedTest)) {
return {
...createApplicantInformationPage(fullSchema1995, {
isVeteran: true,
Function fileUploadUi
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const fileUploadUi = content => {
// a11y focus management. Move focus to select after upload
// see va.gov-team/issues/19688
const addAnotherLabel = 'Upload another file';
Function checkFlags
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function checkFlags(pages, person, newListOfMissingFiles) {
const personUpdated = person; // shallow, updates reflect on actual form state
const wrapped = Array.isArray(pages)
? pages
: Object.keys(pages).map(pg => pages[pg]); // On confirmation, "pages" is obj
Function BehalfOfSomeoneElseContent
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const BehalfOfSomeoneElseContent = () => {
return (
<>
<p>
You’ll need a copy of their sponsor’s DD214 or other separation papers.