Nekito-Development / openkito

Open-Source Crash client based on Niko by @narumii
https://nekito.org
GNU General Public License v3.0
26 stars 6 forks source link

RenameSuggestion #8

Closed AnonymousAccount4SE closed 1 year ago

AnonymousAccount4SE commented 1 year ago

Renaming Suggestion of Method Names to Make Them More Descriptive


Description

We have developed a tool (NameSpotter) for identifying non-descriptive method names, and using this tool we find a non-descriptive method name in your repository:

/* Non-descriptive Method Name in src/main/java/net/minecraft/server/management/ServerConfigurationManager.java*/
public void sendMessageToTeamOrEvryPlayer(EntityPlayer player, IChatComponent message)
    {
        Team team = player.getTeam();

        if (team == null)
        {
            this.sendChatMsg(message);
        }
        else
        {
            for (int i = 0; i < this.playerEntityList.size(); ++i)
            {
                EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntityList.get(i);

                if (entityplayermp.getTeam() != team)
                {
                    entityplayermp.addChatMessage(message);
                }
            }
        }
    }

We consider "sendMessageToTeamOrEvryPlayer" as non-descriptive because it contains a typo, i.e., "Evry" should be "Every".

We have corrected them (including all the occurrences in other file) and submitted a pull request.

Do you agree with the judgment?

kacorvixon1337 commented 1 year ago

bro what