Skip to content

Commit 9e52c02

Browse files
Docs Update
Updates the documentation about the Smell and Spelling aspects and their subaspects as the were modified, and adds documentation about the Formatting aspect that was added.
1 parent 236de7c commit 9e52c02

File tree

69 files changed

+2214
-157
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+2214
-157
lines changed

README.rst

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,45 @@ This repository is automatically generated. To do so, run ``./generate``. This w
55

66
The aspect tree is given below:
77

8+
- `Formatting <Root/Formatting/README.rst>`_
9+
10+
11+
- `Length <Root/Formatting/Length/README.rst>`_
12+
13+
14+
- `FileLength <Root/Formatting/Length/FileLength/README.rst>`_
15+
16+
17+
- `LineLength <Root/Formatting/Length/LineLength/README.rst>`_
18+
19+
20+
- `Quotation <Root/Formatting/Quotation/README.rst>`_
21+
22+
23+
- `Spacing <Root/Formatting/Spacing/README.rst>`_
24+
25+
26+
- `BlankLine <Root/Formatting/Spacing/BlankLine/README.rst>`_
27+
28+
29+
- `BlankLineAfterClass <Root/Formatting/Spacing/BlankLine/BlankLineAfterClass/README.rst>`_
30+
31+
32+
- `BlankLineAfterDeclaration <Root/Formatting/Spacing/BlankLine/BlankLineAfterDeclaration/README.rst>`_
33+
34+
35+
- `BlankLineAfterProcedure <Root/Formatting/Spacing/BlankLine/BlankLineAfterProcedure/README.rst>`_
36+
37+
38+
- `NewlineAtEOF <Root/Formatting/Spacing/BlankLine/NewlineAtEOF/README.rst>`_
39+
40+
41+
- `SpacesAroundOperator <Root/Formatting/Spacing/SpacesAroundOperator/README.rst>`_
42+
43+
44+
- `TrailingSpace <Root/Formatting/Spacing/TrailingSpace/README.rst>`_
45+
46+
847
- `Metadata <Root/Metadata/README.rst>`_
948

1049

@@ -80,9 +119,21 @@ The aspect tree is given below:
80119
- `ClassSmell <Root/Smell/ClassSmell/README.rst>`_
81120

82121

83-
- `ClassLength <Root/Smell/ClassSmell/ClassLength/README.rst>`_
122+
- `ClassSize <Root/Smell/ClassSmell/ClassSize/README.rst>`_
84123

85124

125+
- `ClassConstants <Root/Smell/ClassSmell/ClassSize/ClassConstants/README.rst>`_
126+
127+
128+
- `ClassInstanceVariables <Root/Smell/ClassSmell/ClassSize/ClassInstanceVariables/README.rst>`_
129+
130+
131+
- `ClassLength <Root/Smell/ClassSmell/ClassSize/ClassLength/README.rst>`_
132+
133+
134+
- `ClassMethods <Root/Smell/ClassSmell/ClassSize/ClassMethods/README.rst>`_
135+
136+
86137
- `DataClump <Root/Smell/ClassSmell/DataClump/README.rst>`_
87138

88139

@@ -92,18 +143,30 @@ The aspect tree is given below:
92143
- `Complexity <Root/Smell/Complexity/README.rst>`_
93144

94145

146+
- `CylomaticComplexity <Root/Smell/Complexity/CylomaticComplexity/README.rst>`_
147+
148+
149+
- `MaintainabilityIndex <Root/Smell/Complexity/MaintainabilityIndex/README.rst>`_
150+
151+
95152
- `MethodSmell <Root/Smell/MethodSmell/README.rst>`_
96153

97154

155+
- `MethodLength <Root/Smell/MethodSmell/MethodLength/README.rst>`_
156+
157+
158+
- `ParameterListLength <Root/Smell/MethodSmell/ParameterListLength/README.rst>`_
159+
160+
98161
- `Naming <Root/Smell/Naming/README.rst>`_
99162

100163

101164
- `Spelling <Root/Spelling/README.rst>`_
102165

103166

104-
- `aspectsYEAH <Root/Spelling/aspectsYEAH/README.rst>`_
167+
- `DictionarySpelling <Root/Spelling/DictionarySpelling/README.rst>`_
105168

106169

107-
- `coalaCorrect <Root/Spelling/coalaCorrect/README.rst>`_
170+
- `OrgSpecificWordSpelling <Root/Spelling/OrgSpecificWordSpelling/README.rst>`_
108171

109172

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
+---------------------------------------+----------------------------+------------------------------------------------------------------+
2+
| ``Root.Formatting.Length.FileLength`` | `Parent <../README.rst>`_ | `Index <//github.com/coala/aspect-docs/blob/master/README.rst>`_ |
3+
+---------------------------------------+----------------------------+------------------------------------------------------------------+
4+
5+
6+
+---------------------+------------------------------------------+
7+
| **Sibling aspects** | `LineLength <../LineLength/README.rst>`_ |
8+
+---------------------+------------------------------------------+
9+
10+
FileLength
11+
==========
12+
Number of lines found in a file.
13+
14+
Tastes
15+
========
16+
17+
+--------------------+-----------------------------------+-----------------------------------+
18+
| Taste | Meaning | Values |
19+
+====================+===================================+===================================+
20+
| | | |
21+
|``max_file_length`` | Maximum number of line for a file | **999** +
22+
| | | |
23+
+--------------------+-----------------------------------+-----------------------------------+
24+
25+
26+
\* bold denotes default value
27+
28+
Subaspects
29+
==========
30+
31+
This aspect does not have any sub aspects.
32+
33+
Example
34+
=======
35+
36+
.. code-block:: Python 3
37+
38+
# This file would be a large file if we assume that the max number of
39+
# lines per file is 10
40+
41+
class Node:
42+
def __init__(self, value, left_most_child, left_sibling):
43+
self.value=value
44+
self.left_most_child=left_most_child
45+
self.left_sibling=left_sibling
46+
47+
# This is example is just showing what this aspect is about, because
48+
# the max number of lines per file is usually 999.
49+
50+
51+
Importance
52+
==========
53+
54+
Too long programs (or files) are difficult to read, maintain and
55+
understand.
56+
57+
How to fix this
58+
==========
59+
60+
Splitting files into modules, writing shorter methods and classes.
61+
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
+---------------------------------------+----------------------------+------------------------------------------------------------------+
2+
| ``Root.Formatting.Length.LineLength`` | `Parent <../README.rst>`_ | `Index <//github.com/coala/aspect-docs/blob/master/README.rst>`_ |
3+
+---------------------------------------+----------------------------+------------------------------------------------------------------+
4+
5+
6+
+---------------------+------------------------------------------+
7+
| **Sibling aspects** | `FileLength <../FileLength/README.rst>`_ |
8+
+---------------------+------------------------------------------+
9+
10+
LineLength
11+
==========
12+
Number of characters found in a line of code.
13+
14+
Tastes
15+
========
16+
17+
+--------------------+-----------------------------------------+-----------------------------------------+
18+
| Taste | Meaning | Values |
19+
+====================+=========================================+=========================================+
20+
| | | |
21+
|``max_line_length`` | Maximum number of character for a line. | **80**, 79, 100, 120, 160 +
22+
| | | |
23+
+--------------------+-----------------------------------------+-----------------------------------------+
24+
25+
26+
\* bold denotes default value
27+
28+
Subaspects
29+
==========
30+
31+
This aspect does not have any sub aspects.
32+
33+
Example
34+
=======
35+
36+
.. code-block::
37+
38+
print('The length of this line is 38')
39+
40+
41+
Importance
42+
==========
43+
44+
Too long lines make code very difficult to read and maintain.
45+
46+
How to fix this
47+
==========
48+
49+
Splitting long lines of code into multiple shorter lines whenever
50+
possible. Avoiding the usage of in-line language specific constructs
51+
whenever they result in too long lines.
52+

Root/Formatting/Length/README.rst

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
+----------------------------+----------------------------+------------------------------------------------------------------+
2+
| ``Root.Formatting.Length`` | `Parent <../README.rst>`_ | `Index <//github.com/coala/aspect-docs/blob/master/README.rst>`_ |
3+
+----------------------------+----------------------------+------------------------------------------------------------------+
4+
5+
6+
+---------------------+----------------------------------------+------------------------------------+
7+
| **Sibling aspects** | `Quotation <../Quotation/README.rst>`_ | `Spacing <../Spacing/README.rst>`_ |
8+
+---------------------+----------------------------------------+------------------------------------+
9+
10+
Length
11+
======
12+
Hold sub-aspects for file and line length.
13+
14+
Subaspects
15+
==========
16+
17+
* `FileLength <FileLength/README.rst>`_
18+
* `LineLength <LineLength/README.rst>`_
19+
Example
20+
=======
21+
22+
.. code-block:: Python
23+
24+
# We assume that the maximum number of characters per line is 10
25+
# and that the maximum number of lines per files is 3.
26+
27+
def run(bear, file, filename, aspectlist):
28+
return bear.run(file, filename, aspectlist)
29+
30+
31+
Importance
32+
==========
33+
34+
Too long lines of code and too large files result in code difficult to
35+
read, understand and maintain.
36+
37+
How to fix this
38+
==========
39+
40+
Length issues can be fixed by writing shorter lines of code (splitting
41+
long lines into multiple shorter lines); writing shorter files
42+
(splitting files into modules, writing shorter methods and classes.).
43+
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
+-------------------------------+----------------------------+------------------------------------------------------------------+
2+
| ``Root.Formatting.Quotation`` | `Parent <../README.rst>`_ | `Index <//github.com/coala/aspect-docs/blob/master/README.rst>`_ |
3+
+-------------------------------+----------------------------+------------------------------------------------------------------+
4+
5+
6+
+---------------------+----------------------------------+------------------------------------+
7+
| **Sibling aspects** | `Length <../Length/README.rst>`_ | `Spacing <../Spacing/README.rst>`_ |
8+
+---------------------+----------------------------------+------------------------------------+
9+
10+
Quotation
11+
=========
12+
Quotation mark used for strings and docstrings.
13+
14+
Tastes
15+
========
16+
17+
+------------------------+------------------------------------+------------------------------------+
18+
| Taste | Meaning | Values |
19+
+========================+====================================+====================================+
20+
| | | |
21+
|``preferred_quotation`` | Represents the preferred quotation | **'**, " +
22+
| | | |
23+
+------------------------+------------------------------------+------------------------------------+
24+
25+
26+
\* bold denotes default value
27+
28+
Subaspects
29+
==========
30+
31+
This aspect does not have any sub aspects.
32+
33+
Example
34+
=======
35+
36+
.. code-block:: Python
37+
38+
# Here is an example of code where both '' and "" quotation mark
39+
# Are used.
40+
41+
string = 'coala is always written with lowercase c.'
42+
string = "coala is always written with lowercase c."
43+
44+
45+
Importance
46+
==========
47+
48+
Using the same quotation whenever possible in the code, improve on its
49+
readability by introducing consistency.
50+
51+
How to fix this
52+
==========
53+
54+
Choosing a preferred quotation and using it everywhere (if possible).
55+

Root/Formatting/README.rst

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
+---------------------+----------------------------+------------------------------------------------------------------+
2+
| ``Root.Formatting`` | `Parent <../README.rst>`_ | `Index <//github.com/coala/aspect-docs/blob/master/README.rst>`_ |
3+
+---------------------+----------------------------+------------------------------------------------------------------+
4+
5+
6+
+---------------------+--------------------------------------+------------------------------------------+--------------------------------------+--------------------------------+--------------------------------------+
7+
| **Sibling aspects** | `Metadata <../Metadata/README.rst>`_ | `Redundancy <../Redundancy/README.rst>`_ | `Security <../Security/README.rst>`_ | `Smell <../Smell/README.rst>`_ | `Spelling <../Spelling/README.rst>`_ |
8+
+---------------------+--------------------------------------+------------------------------------------+--------------------------------------+--------------------------------+--------------------------------------+
9+
10+
Formatting
11+
==========
12+
The visual appearance of source code.
13+
14+
Subaspects
15+
==========
16+
17+
* `Length <Length/README.rst>`_
18+
* `Quotation <Quotation/README.rst>`_
19+
* `Spacing <Spacing/README.rst>`_
20+
Example
21+
=======
22+
23+
.. code-block:: Python
24+
25+
# Here is an example of Python code with lots of
26+
# formatting issues including: trailing spaces, missing spaces
27+
# around operators, strange and inconsistent indentation etc.
28+
29+
z = 'hello'+'world'
30+
def f ( a):
31+
pass
32+
33+
34+
Importance
35+
==========
36+
37+
A coding style (the of rules or guidelines used when writing the
38+
source code) can drastically affect the readability, and
39+
maintainability of a program and might as well introduce bugs.
40+
41+
How to fix this
42+
==========
43+
44+
Defining a clearly and thoughtful coding style (based on the available
45+
ones given the programming language in use) and strictly respect it or
46+
apply it through out the implementation of a project.
47+

0 commit comments

Comments
 (0)