Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display Names P2 #94

Merged
merged 1 commit into from
Sep 18, 2024
Merged

Display Names P2 #94

merged 1 commit into from
Sep 18, 2024

Conversation

mdickson
Copy link
Collaborator

PR from Ruby's display names branch/repo

Comment on lines +60 to +62
if (LastName.ToLower() == "resident")
return FirstName;
else return $"{FirstName} {LastName}";

Check notice

Code scanning / CodeQL

Missed ternary opportunity Note

Both branches of this 'if' statement return - consider using '?' to express intent better.
Comment on lines +90 to +92
if (IsNameDefault)
return LegacyName;
else return DisplayName;

Check notice

Code scanning / CodeQL

Missed ternary opportunity Note

Both branches of this 'if' statement return - consider using '?' to express intent better.
{
OSDArray name = req["display_name"] as OSDArray;

string oldName = name[0].AsString();

Check warning

Code scanning / CodeQL

Dereferenced variable may be null Warning

Variable
name
may be null at this access because of
this
assignment.
Comment on lines +235 to +238
if (d.Data.ContainsKey("DisplayName") && d.Data["DisplayName"] != null)
u.DisplayName = d.Data["DisplayName"].ToString();
else
u.DisplayName = string.Empty;

Check notice

Code scanning / CodeQL

Missed ternary opportunity Note

Both branches of this 'if' statement write to the same variable - consider using '?' to express intent better.
Comment on lines +615 to +617
if (cmdparams.Length < 4)
firstName = MainConsole.Instance.Prompt("First name");
else firstName = cmdparams[3];

Check notice

Code scanning / CodeQL

Missed ternary opportunity Note

Both branches of this 'if' statement write to the same variable - consider using '?' to express intent better.
Comment on lines +619 to +621
if (cmdparams.Length < 5)
lastName = MainConsole.Instance.Prompt("Last name");
else lastName = cmdparams[4];

Check notice

Code scanning / CodeQL

Missed ternary opportunity Note

Both branches of this 'if' statement write to the same variable - consider using '?' to express intent better.
Comment on lines +623 to +625
if (cmdparams.Length < 6)
displayName = MainConsole.Instance.Prompt("Display name");
else displayName = cmdparams[5];

Check notice

Code scanning / CodeQL

Missed ternary opportunity Note

Both branches of this 'if' statement write to the same variable - consider using '?' to express intent better.
@mdickson mdickson merged commit 0e09536 into OpenSim-NGC:develop Sep 18, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants