microsoft / macos-cookbook
Duplication

Places in code with 6 or more lines that are exactly the same.

Intro
  • For duplication, we look at places in code where there are 6 or more lines of code that are exactly the same.
  • Before duplication is calculated, the code is cleaned to remove empty lines, comments, and frequently duplicated constructs such as imports.
  • You should aim at having as little as possible (<5%) of duplicated code as high-level of duplication can lead to maintenance difficulties, poor factoring, and logical contradictions.
Learn more...
Duplication Overall
  • 15% duplication:
    • 2,854 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 429 duplicated lines
  • 32 duplicates
system15% (429 lines)
Duplication per Extension
rb15% (405 lines)
yml12% (24 lines)
Duplication per Component (primary)
spec/unit/resources42% (231 lines)
spec/unit/libraries15% (136 lines)
libraries3% (24 lines)
ROOT12% (24 lines)
resources2% (14 lines)
attributes0% (0 lines)
spec0% (0 lines)

Duplication Between Components (50+ lines)

G spec/unit/libraries spec/unit/libraries spec/unit/resources spec/unit/resources spec/unit/libraries--spec/unit/resources 172

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 20 longest duplicates.
See data for all 32 duplicates...
Size#FoldersFilesLinesCode
62 x 2 spec/unit/libraries
spec/unit/resources
xcode_spec.rb
xcode_spec.rb
8:69 (17%)
13:74 (28%)
view
12 x 2 ROOT
ROOT
azure-pipelines.yml
azure-pipelines.yml
8:19 (19%)
26:37 (19%)
view
11 x 2 spec/unit/libraries
spec/unit/resources
xcode_spec.rb
xcode_spec.rb
72:82 (3%)
77:87 (5%)
view
10 x 2 spec/unit/resources
spec/unit/resources
automatic_software_updates_spec.rb
automatic_software_updates_spec.rb
64:75 (6%)
165:176 (6%)
view
9 x 2 spec/unit/resources
spec/unit/resources
automatic_software_updates_spec.rb
automatic_software_updates_spec.rb
120:130 (5%)
137:147 (5%)
view
9 x 2 spec/unit/resources
spec/unit/resources
automatic_software_updates_spec.rb
automatic_software_updates_spec.rb
85:94 (5%)
172:181 (5%)
view
8 x 2 spec/unit/libraries
spec/unit/libraries
command_line_tools_spec.rb
command_line_tools_spec.rb
41:48 (7%)
62:69 (7%)
view
7 x 2 resources
resources
command_line_tools.rb
command_line_tools.rb
15:22 (20%)
30:37 (20%)
view
7 x 2 spec/unit/libraries
spec/unit/libraries
xcode_spec.rb
xcode_spec.rb
175:181 (2%)
184:190 (2%)
view
7 x 2 spec/unit/libraries
spec/unit/resources
command_line_tools_spec.rb
command_line_tools_spec.rb
103:109 (6%)
47:53 (12%)
view
7 x 2 spec/unit/libraries
spec/unit/libraries
xcode_spec.rb
xcode_spec.rb
310:317 (2%)
319:326 (2%)
view
7 x 2 spec/unit/resources
spec/unit/resources
xcode_spec.rb
xcode_spec.rb
109:117 (3%)
244:252 (3%)
view
6 x 2 libraries
libraries
remote_management.rb
security_cmd.rb
33:39 (18%)
65:71 (10%)
view
6 x 2 libraries
libraries
remote_management.rb
xcode.rb
33:39 (18%)
173:179 (4%)
view
6 x 2 libraries
libraries
remote_management.rb
xcversion.rb
33:39 (18%)
57:63 (12%)
view
6 x 2 spec/unit/resources
spec/unit/resources
xcode_spec.rb
xcode_spec.rb
143:149 (2%)
181:187 (2%)
view
6 x 2 spec/unit/resources
spec/unit/resources
xcode_spec.rb
xcode_spec.rb
120:126 (2%)
181:187 (2%)
view
6 x 2 libraries
libraries
security_cmd.rb
xcode.rb
65:71 (10%)
173:179 (4%)
view
6 x 2 spec/unit/resources
spec/unit/resources
remote_management_spec.rb
remote_management_spec.rb
81:87 (7%)
94:100 (7%)
view
6 x 2 spec/unit/libraries
spec/unit/libraries
command_line_tools_spec.rb
command_line_tools_spec.rb
43:48 (5%)
84:89 (5%)
view