You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>This is the documentation for the development version of OCLint, see the <ahref="http://oclint.org/releases.html">Releases</a> page for released documentations.</p>
OCLint {{ release }} Documentation is licensed under a <arel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.
131
+
<br/>
132
+
Maintained by <ahref="http://www.ryuichisaito.com/?ref=oclint">Ryuichi Saito</a>.
134
133
{%- if show_sphinx %}
135
134
{% trans sphinx_version=sphinx_version|e %}Created using <ahref="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}<br/>
Copy file name to clipboardExpand all lines: devel/checkout.rst
+1-1
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ In addition, ``clang`` script does more than that:
60
60
* Second, you can check out a branch codebase other than the trunk codebase by ``./clang checkout -branch <branch_name>``
61
61
62
62
googletest/googlemock
63
-
--------------------
63
+
---------------------
64
64
65
65
Google C++ Testing and Mocking Frameworks are used for testing OCLint. OCLint follows `Test Driven Development <http://en.wikipedia.org/wiki/Test-driven_development>`_ (TDD), so checkout them before we work on this codebase and want to make sure the modifications do not break the other pieces of code.
This page contains a TODO list in a large picture. You can understand it as a road map. Some of them are small, but some are infinitely big. Implementation schedule of these projects are very flexible, we also release partial progress of some big projects if they look good and provide benefits to users.
4
+
This page shows the the roadmap of this project. We warmly welcome all sorts of contributions. Please use `oclint-dev mailing list <https://groups.google.com/group/oclint-dev>`_ for the best discussion channel, and use it for more ideas and suggestions.
5
+
6
+
.. seealso::
7
+
8
+
Tasks in the pipeline, under discussion and being implemented can be found at `GitHub Issues <https://github.com/oclint/oclint/issues>`_ page.
5
9
6
-
OCLint started as a research project, so in addition to the features that are designed for industrial usage, there are some projects here that could be very interesting research projects in their own right. Users can leverage the research results for higher accuracy, better performance, more reasonable software metrics, and so on.
7
10
8
-
In any case, we welcome all contributions. If you are thinking one of them, please send an email to `oclint-dev mailing list <https://groups.google.com/group/oclint-dev>`_, so that we know this is being worked on. Please use the same mailing list to suggest more projects to this page.
9
11
10
12
More Rules
11
13
----------
@@ -24,11 +26,6 @@ More interesting metrics can help developers measure their source code in differ
24
26
25
27
OCLint's metrics module is actually a cohesive library, it can be reused in your project without any OCLint dependencies. So, the new introduced metrics should only depend on abstract syntax tree representation.
26
28
27
-
Better Build System
28
-
-------------------
29
-
30
-
Using bash scripts to organize the build system is not as good as letting the build system handles this by itself. We already use CMake in every modules, so now, we need to figure out a way to let CMake handle all projects under the OCLint umbrella.
31
-
32
29
Package Manager Build
33
30
---------------------
34
31
@@ -39,85 +36,23 @@ Xcode Plugin/Addon/Extension
39
36
40
37
We are happy with existing `oclint-xcodebuild <../guide/oclint-xcodebuild.html>`_, but we also want to provide a graphic interface for Xcode users. The idea is either being a Xcode plugin to be able to invoke OCLint inside Xcode, or being a standalone extension to open a Xcode workspace/project, select scheme, target, and other settings, then show source code with inline analysis results.
41
38
42
-
Control Flow Graphic Engine
43
-
---------------------------
39
+
Research Interests
40
+
------------------
44
41
45
-
A strong control flow graphic engine can help with a better understand of the order that statements, expressions, and functions are evaluated or executed. For instance, goto statements force program to jump to a different statement, if statements execute a branch of statements only if certain conditions are met, while statements run the code inside a loop iteratively, etc. It helps increase the analysis accuracy and avoid false positives.
46
-
47
-
We have applied control flow analysis in some existing rules, but we would like to have an engine to gain a more comprehensive understanding of the source code.
42
+
OCLint started as a research project, so some ideas here can be explored much more with critical thinking. In addition, the tool can continue leveraging the research conclusions for higher accuracy, better performance, more reasonable software metrics, and so on.
48
43
44
+
Source Code Metrics
45
+
More metrics could be explored and benefit the quality of source code.
46
+
Control Flow Graphic Engine
47
+
A strong control flow graphic engine can help with a better understand of the order that statements, expressions, and functions are evaluated or executed. For instance, goto statements force program to jump to a different statement, if statements execute a branch of statements only if certain conditions are met, while statements run the code inside a loop iteratively, etc. It helps increase the analysis accuracy and avoid false positives. We have applied control flow analysis in some existing rules, but we would like to have an engine to gain a more comprehensive understanding of the source code.
49
48
Data Flow Engine
50
-
----------------
51
-
52
-
Data flow provides global information about how a procedure manipulates its data, such as the use, declaration and dependency of the data. For example, a new value could be assigned to an existing variable, and the memory address of a pointer can be reallocated.
53
-
54
-
It is easier to detect the data flow in runtime. However, certain dynamic behaviors of the data can be also determined in static code analysis with data flow engine. Data flow engine is a big supplement to control flow engine.
55
-
56
-
Code Duplication and Logic Duplication Detection
57
-
------------------------------------------------
58
-
59
-
We hope to apply `Rabin–Karp string search algorithm <http://en.wikipedia.org/wiki/Rabin%E2%80%93Karp_string_search_algorithm>`_ in code duplication detection.
60
-
61
-
When it comes to logic duplication detection, there are many interesting experiments that we can conduct. But first of all, your humbled author has to admit that currently I don't have a complete definition of logic duplication. But let's think about the following interesting case:
62
-
63
-
Let's say, 20 years ago, long before I join my current company, a senior developer had written a method like this
64
-
65
-
.. code-block:: c++
66
-
67
-
void foo(int x, int y)
68
-
{
69
-
cout << x - y;
70
-
cout << x * y;
71
-
}
72
-
73
-
And 10 years ago, he left the company. But his code is still in a base level library.
74
-
75
-
I joined this company after my graduation from college, 10 years after he left the company, so almost all my teammates even don't know the existence of the method above. And one day, I occasionally write something like this
76
-
77
-
.. code-block:: c++
78
-
79
-
void bar()
80
-
{
81
-
cout << 1 + 2;
82
-
cout << 1 - 2;
83
-
cout << 1 * 2;
84
-
cout << 1 / 2;
85
-
}
86
-
87
-
Now, in this case, I really hope to be informed that I can change my code to
88
-
89
-
.. code-block:: c++
90
-
91
-
void bar()
92
-
{
93
-
cout << 1 + 2;
94
-
foo(1, 2);
95
-
cout << 1 / 2;
96
-
}
97
-
98
-
This might not be a perfect example, but I hope you can feel a little bit about the meaning of ``logic duplication`` here. This is a valuable feature to many organizations that have to maintain large codebase, especially with many legacy code. In order to find out the logic duplication in the early stage of development can truly help them reduce the high maintenance in the future.
99
-
49
+
Data flow provides global information about how a procedure manipulates its data, such as the use, declaration and dependency of the data. For example, a new value could be assigned to an existing variable, and the memory address of a pointer can be reallocated. It is easier to detect the data flow in runtime. However, certain dynamic behaviors of the data can be also determined in static code analysis with data flow engine. Data flow engine is a big supplement to control flow engine.
50
+
Code Duplication Detection
51
+
Duplicated code is problematic, the command text-based duplication detection could be highly improved with source code logic based duplication detection.
100
52
Refactoring Suggestions
101
-
-----------------------
102
-
103
-
In addition to detecting code defects that break our defined rule set, we hope to provide you suggestions of how to improve your code by refactoring. We hope to do it smartly and intelligently that the suggestions will be given after fully analyzing the context of the rot code.
104
-
105
-
Design Patterns Extraction
106
-
--------------------------
107
-
108
-
It's helpful to know the design patterns we have applied in our codebase.
109
-
53
+
In addition to detecting code defects that break our defined rule set, we hope to provide you suggestions of how to improve your code by refactoring. We hope to do it smartly and intelligently that the suggestions will be given after fully analyzing the context of the rot code.
54
+
Design Patterns Recognition
55
+
It's helpful to know the design patterns we have applied in our codebase.
110
56
Type Inference
111
-
--------------
112
-
113
-
We know we can sometimes cheat to let compilers happy with certain things. This is a very dangerous practice.
114
-
115
-
But, on the other hand, sometimes, we also want to take the advantages of the dynamic of programming languages, like void pointer in C and C++, and ``id`` in Objective-C, even though they are static typed languages.
116
-
117
-
In fact, we believe type inference, the technique of automatically deduce, either partially or fully, the type even at compile time.
118
-
119
-
However, this largely increase the false positive in static code analysis.
120
-
121
-
Luckily, as the development of programming language techniques, type inference is introduced as a technique to automatically deduce, either partially or fully, the type of an expression at compile time. Many static typed languages have type inference capabilities builtin nowadays, so that as a developer, even though it's a static typed language, but you could omit the type annotations without explicitly telling the compiler the type.
57
+
We know we can sometimes cheat to let compilers happy with certain things. This is a very dangerous practice. But, on the other hand, sometimes, we also want to take the advantages of the dynamic of programming languages, like void pointer in C and C++, and ``id`` in Objective-C, even though they are static typed languages. In fact, we believe type inference, the technique of automatically deduce, either partially or fully, the type even at compile time. However, this largely increase the false positive in static code analysis. Luckily, as the development of programming language techniques, type inference is introduced as a technique to automatically deduce, either partially or fully, the type of an expression at compile time. Many static typed languages have type inference capabilities builtin nowadays, so that as a developer, even though it's a static typed language, but you could omit the type annotations without explicitly telling the compiler the type. In this case, we can apply the same technique in static code analysis in order to lower false positive, and improve the accuracy at the same time.
122
58
123
-
In this case, we can apply the same technique in static code analysis in order to lower false positive, and improve the accuracy at the same time.
0 commit comments