Comments (5)
Hi @joekain,
Thanks again for working on these two rules.
They are two very outstanding types of code smells, and I believe recognizing them is very important for improving code quality.
The biggest problem I could see is common C++/STL style tends to encourage some data clumping (especially with iterators) and feature envy of container classes.
I agree with you, and C++/STL gives us headache elsewhere as well. However, this is due to the lack of capability of filtering system headers or third-party libraries out of the analysis context. This is clearly something in this project's roadmap.
For these two rules, since they are so important, let's work together on them with baby steps. If you like, maybe you can create two pull requests for two rules, and we start with analyzing Objective-C only by keeping only VisitObjCMethodDecl
in the AST traversal. Improve the test cases for Objective-C. And then start supporting C++ little by little. I am expecting to come up with the idea of dealing with std along the way.
Let me know if your thoughts, thanks.
from oclint.
Hi @lqi,
Starting with Objective-C only works for me. I'll try to find time this week to remove the C++ support and then send a pull request for Feature Envy.
Data Clump may take a little more time. I've found a problem with my implementation in that if it reports a clump of variables (a, b, c) then it will also report (a, b), (a, c), and (b, c) which adds a lot of unnecessary noise to the report. I'll put together a pull request with the current version if you like, but I don't think its ready to merge yet.
from oclint.
Starting with Objective-C only works for me. I'll try to find time this week to remove the C++ support and then send a pull request for Feature Envy.
Sure, thanks. Comment out C++ support for now, since our goal is to get back to this when Objective-C support is a little mature.
if it reports a clump of variables (a, b, c) then it will also report (a, b), (a, c), and (b, c)
Feel free to submit the pull request, you could start adding the test cases for these scenarios and let them fail, and then work to pass these tests.
Sincerely appreciate your time, @joekain.
from oclint.
if it reports a clump of variables (a, b, c) then it will also report (a, b), (a, c), and (b, c)
Feel free to submit the pull request, you could start adding the test cases for these scenarios and let them fail,
and then work to pass these tests.
Ah, great idea @lqi. I'll start with that.
from oclint.
Hi @lqi, sorry a month ago I started getting the FeatureEnvy pull request together but found I was unable to build the whole project. Then I ran out of free time. I was finally able to get back to this and thankfully was also able to build again.
from oclint.
Related Issues (20)
- undefined reference to std::_Sp_make_shared_tag::_S_eq(std::type_info const&) HOT 5
- Compile successfully but report has many compiler error but Xcode is Normal compilation success HOT 13
- lLVVM Error HOT 2
- project use MMKV lib could analyse error HOT 5
- How do I use the same compiler as Xcode? HOT 6
- what version are clang and llvm oclint version 22.02? HOT 2
- Crash on Xcode 14 when used via Fastlane HOT 2
- xcodebuild failed when use OCLint in Xcode HOT 6
- xcode14 not work HOT 3
- oclint doesn't work: a lot of compiler errors in oclint_result.html. Xcode 14.1 oclint 22.02 HOT 16
- sonar-reports/SonarDemo-oclint.xml' failed with error code: 6 HOT 2
- Request for enhancement: Upgrade OCLint to LLVM 15.0.7, moving away from the prior version, LLVM 13.0.0 HOT 2
- OClint on windows 10 HOT 2
- Please upgrade oclint to llvm14.0 HOT 16
- Feature request: adjust threshold for one function HOT 2
- oclint: error: compilation contains multiple jobs: OCLint 22.02 + MacOS Ventura 13.0 + XCode 14.3 HOT 11
- Xcode14.3,OCLint: 20.11 oclint: error: compilation contains multiple jobs: HOT 22
- high amount of RAM used HOT 2
- With the same compilation options, clang compiles successfully, but oclint encounters problems during compilation HOT 4
- Xcode 15, OCLint 22.02, oclint: error: compilation contains multiple jobs: HOT 5
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 oclint.