Showing 15 of 35 total issues
File EmojiList.java
has 474 lines of code (exceeds 250 allowed). Consider refactoring. Open
package ru.shemplo.chat.neerc.gfx.panes;
import javafx.application.Platform;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
File MainSceneHolder.java
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
package ru.shemplo.chat.neerc.gfx.scenes;
import static java.time.ZoneOffset.*;
import static ru.shemplo.chat.neerc.enities.MessageEntity.MessageAccess.*;
Method _makeDefaultMessage
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void _makeDefaultMessage (Pane container, MessageEntity message) {
String tmpBody = message.getBody (), ident = "(\\w|_|-)+";
final Pattern emojiPattern
= Pattern.compile (String.format (":%s:", ident));
final Insets insets = new Insets (0, 8, 0, 0);
Method changeStatusByClicking
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private void changeStatusByClicking () {
RequestIQ requestIQ = null;
if (type.equals (CONFIRM)) {
requestIQ = new TaskStatusIQ (taskID,
taskStatus.equals (SUCCESS) ? NONE: SUCCESS, "");
- 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
Method route
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void route (Message message) {
if (message.getBody () == null) { return; }
final String from = message.getFrom ().asUnescapedString (),
Method onUsersUpdated
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void onUsersUpdated () {
SceneComponent.USERS_H.<HBox> safe (holder.getScene ())
.ifPresent (line -> {
Platform.runLater (line.getChildren ()::clear);
Method mergeTasks
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public synchronized void mergeTasks (Collection <TaskEntity> tasks) {
boolean numberOfTasksChanged = this.tasks.size () != tasks.size ();
List <String> keys = new ArrayList <> (this.tasks.keySet ());
Set <String> keep = new HashSet <> (tasks.stream ()
. map (TaskEntity::getId)
Method makeDefaultButtons
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
private final void makeDefaultButtons () {
Button reconnect = SceneComponent.RECONNECT_BUTTON.get (scene);
reconnect.setOnAction (__ -> {
new Thread (manager.getSharedContext ().getClientAdapter ()::performReconnection)
. start (); // Not to block GUI thread
Method updateItem
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected void updateItem (MessageEntity item, boolean empty) {
super.updateItem (item, empty || item == null);
if (empty || item == null) {
setGraphic (null);
Method makeDefaultTabs
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private final void makeDefaultTabs () {
DetachableTab publicChatTab = new DetachableTab ("public");
openedTabs.put (publicChatTab.getText (), publicChatTab);
final Conversation publicConversation
= new Conversation (this, publicChatTab.getText ());
Method onUserChangedPresence
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void onUserChangedPresence (String user, OnlineStatus status) {
Image image = Stream.of (status)
. map (OnlineStatus::name)
. map (String::toLowerCase)
Method controllOtherRoomChatMessage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
@DestinationValue ("body") String body,
@DestinationValue ("time") LocalDateTime time,
@DestinationValue ("author") String author,
@DestinationValue ("room") String room,
@DestinationValue ("id") String id) {
Method controllWisperChatMessage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
@DestinationValue ("body") String body,
@DestinationValue ("time") LocalDateTime time,
@DestinationValue ("author") String author,
@DestinationValue ("recipient") String recipient,
@DestinationValue ("id") String id) {
Method route
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void route (Message message) {
if (message.getBody () == null) { return; }
final String from = message.getFrom ().asUnescapedString (),
- 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
Method processPacket
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void processPacket (Packet packet) {
if (packet instanceof Message) {
final Message input = (Message) packet;
- 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"