Visitar URL original
Not properly detecting loc in the case of an es6 arrow function expression? · Issue #895 · codeclimate/codeclimate · GitHub
The Wayback Machine - https://web.archive.org/web/20201018232250/https://github.com/codeclimate/codeclimate/issues/895
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

Not properly detecting loc in the case of an es6 arrow function expression? #895

Open
dfreire opened this issue Feb 28, 2019 · 0 comments
Open
Assignees

Comments

@dfreire
Copy link

@dfreire dfreire commented Feb 28, 2019 •

Hi,

We're running code climate on a React project and we have noticed something.

If we have a stateless component that exceeds the allowed number of lines of code, like:

const SomeComponent = () => {
  return (
    <div>
      {/* ... dozens of lines of code ... */}
    </div>
  );
}

As expected, we get a code smell saying:
Function SomeComponent has X lines of code (exceeds 50 allowed)

But, if we change the code to the equivalent:

const SomeComponent = () => (
  <div>
    {/* ... dozens of lines of code ... */}
  </div>
);

We don't get any code smell.

The same thing happens in regular es6 (non-React) code.

Why is that? Is it possible to fix this?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.