code-cracker / code-cracker

An analyzer library for C# and VB that uses Roslyn to produce refactorings, code analysis, and other niceties.
http://code-cracker.github.io/
Apache License 2.0
1.13k stars 279 forks source link

Verifies if "reference type" parameters are null #132

Open ElemarJR opened 9 years ago

ElemarJR commented 9 years ago
void Foo(Fee a)
{
}

becomes

void Foo(Fee a)
{
   if (a == null) throw new ArgumentNullException(nameof(a))
}

Style: Refactoring Severity: Hidden Id: CC0078

@clklachu is working on it.

sharwell commented 9 years ago

This is more or less a duplicate of https://github.com/DotNetAnalyzers/NullParameterCheckRefactoring.

ElemarJR commented 9 years ago

Yes. It is.

shubheksha commented 8 years ago

I'm a newcomer, so I'm a little lost in the codebase. I understand what is to be done, but which files need to be changed?

giggio commented 8 years ago

@shubhekshajalan Take a look at commit 718539eeeb757105fa58b823e93b44c3a924305f. You will see 9 changed files. You can ignore the first one, runTestsCS.ps1, that was another change that made into the commit. And actually only 3 files are created, only 2 updated, the other 3 are updated by Visual Studio.

That commit is a good example of a commit that creates an analyzer and a code fix. What is necessary:

CodeCracker.csproj, CodeCracker.Test.csproj and Resources.Designer.cs are updated automatically by Visual Studio.

Do you want to work on this issue? We can help you if have any trouble.

clklachu commented 8 years ago

Hi @giggio I'm a first timer and i would like to work on this issue, Could you please assign it to me? I will get back on any doubts.

giggio commented 8 years ago

@clklachu go ahead.

MhdTlb commented 7 years ago

Is this issue still open? Can I work on it?

carloscds commented 7 years ago

@MhdTlb It's open, go ahead!