Comments (7)
Nope it is not possible to ignore a specific line of code in this moment.
from phpmnd.
Hi @sidz,
Thanks for the quick reply. Ok, so I didn't miss something :)
from phpmnd.
You can ignore every instance by using intval(10) instead of just 10. It's not ideal as you wouldn't know by looking at intval(10) that it's used to ignore a check for phpmnd.
Sounds a good feature request though :)
from phpmnd.
Yes and also it adds unneeded function calls.
I also tried to use string, the Drupal form API is enough permissive to do that, but I don't want to do that too. Typing is more and more enforced and changing the values type just to satisfy a code quality tool is a non-sense in my opinion.
Thanks for your feedback :)
from phpmnd.
Yeah agreed. I think the same about comments to ignore lines tbh. The array key whitelist is not a bad idea.
There is also a check in phpmnd for numeric strings which is good to enable as well. Which stops just hiding numbers by converting to a string
from phpmnd.
I like the feature to ignore specific array keys :) I see how it could be useful
from phpmnd.
I would love to add this tool to my default workflow but it runs against 30+ projects and being able to "exempt" individual lines would be absolutely crucial. The array keys bit is not a deal-breaker for me, especially since you could always do this:
$weight = 10; // @phpmnd-ignore-line
$data = [
'weight' => $weight,
];
I would like to put forth a bounty on the line exemption comment feature - anyone willing to match? @exussum12 Can you provide a fair amount or expected time to implement?
from phpmnd.
Related Issues (20)
- Update Composer To Support Latest Version of php-timer HOT 3
- Any plans to provide this functionality as part of other general static analysers? HOT 1
- Syntax error when using class called `Match` in the code HOT 6
- Dependency phpunit/php-timer HOT 4
- PHP 8 HOT 14
- New release needed ! HOT 2
- Cache failure in CI HOT 3
- Extension support for Exceptions possible? HOT 4
- What is "12" in Printer\XML ? HOT 5
- New phpunit schema HOT 2
- Option to disable the highlighter
- Support github action output format HOT 1
- Add ncurses dependency or test tput availability HOT 4
- New release HOT 4
- tput binary not found in alpine based images HOT 2
- Version 3.0 still renders version 2.5 HOT 8
- How to define the most strict configuration possible for phpmnd ? HOT 1
- phpunit/php-timer v6 support? HOT 2
- [Question] Which output formats are available? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpmnd.