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

Add rules, fix issues and cleanup #96

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Shadowghost
Copy link
Contributor

No description provided.

Comment on lines +1268 to +1276
foreach (var element in servicesList)
{
var service = Create(element);

if (service is not null)
{
deviceServices.Add(service);
}
}

Check notice

Code scanning / CodeQL

Missed opportunity to use Select Note

This foreach loop immediately
maps its iteration variable to another variable
- consider mapping the sequence explicitly using '.Select(...)'.
src/Rssdp/HttpRequestParser.cs Fixed Show fixed Hide fixed
src/Rssdp/SsdpDevicePublisher.cs Fixed Show fixed Hide fixed
src/Rssdp/SsdpDevicePublisher.cs Fixed Show fixed Hide fixed
src/.editorconfig Outdated Show resolved Hide resolved
@@ -170,7 +219,7 @@ public static IEnumerable<string> BuildVideoHeader(
";DLNA.ORG_FLAGS={0}",
DlnaMaps.FlagsToString(flagValue));

ResponseProfile mediaProfile = profile.GetVideoMediaProfile(
ResponseProfile? mediaProfile = profile.GetVideoMediaProfile(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just var it?

Copy link
Member

@oddstr13 oddstr13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like apply linting rules -> fix lints, in addition to nullability stuff and documentation (presumably linter-demanded).

I don't know the implications of Array.Empty<Type>() -> [], if any.

This is a rubber-stamp from my part, I've looked at all the changes, and nothing obvious popped out at me.

Visual inspection only, no testing done – but I did note that JPRM compiled it fine in CI.

return name switch
return _disposed
? throw new ObjectDisposedException(GetType().Name)
: name switch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this linter recommended?
I personally don't think this makes the code easier to read.

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.

5 participants