---
title: "Inappropriate Intimacy"
type: "code-smell"
slug: "inappropriate-intimacy"
url: "http://localhost:3000/en/smells/inappropriate-intimacy.md"
category: "Couplers"
description: "One class uses the internal fields and methods of another class."
---
# Inappropriate Intimacy

> One class uses the internal fields and methods of another class.

## Signs and Symptoms

One class uses the internal fields and methods of another class.

## Reasons for the Problem

Keep a close eye on classes that spend too much time together. Good classes should know as little about each other as possible. Such classes are easier to maintain and reuse.

## Payoff

* Improves code organization.
* Simplifies support and code reuse.
## Relations

**Treated by**

- [Move Method](/en/move-method.md)
- [Move Field](/en/move-field.md)
- [Extract Class](/en/extract-class.md)
- [Hide Delegate](/en/hide-delegate.md)
- [Change Bidirectional Association to Unidirectional](/en/change-bidirectional-association-to-unidirectional.md)
- [Replace Delegation with Inheritance](/en/replace-delegation-with-inheritance.md)


## Detected by

- **pmd** `CouplingBetweenObjects` — Coupling Between Objects (CBO) (https://pmd.github.io/pmd/pmd_rules_java_design.html#couplingbetweenobjects)
