Questions tagged [code-metrics]

Software metrics are quantitative data pertaining to source code, e.g. number of lines of code (LOC) for a file.

Questions with this tag will often be about which metrics are most useful for certain purposes or which tools are available to provide certain metrics.

276 questions
0
votes
1 answer

code metrics KPI for MVVM program complexity

code analysis could give some statistic numbers, which are not determinant, but good to start with, if you are looking at some design defect or bad coding practice. such KPIs could be how many methods in a class, or how may levels of if/else…
athos
  • 6,120
  • 5
  • 51
  • 95
0
votes
3 answers

Measuring various aspects of code

Is there a tool that is able to measure the frequency of function calls in a project and counts other aspects (for statistics purposes) of Python code? thank you
xralf
  • 3,312
  • 45
  • 129
  • 200
0
votes
0 answers

Gitlab-CI: Python radon output to Open Metrics format

In my .gitlab-ci.yml script, I have a metrics job that currently runs the radon tool (https://radon.readthedocs.io/en/latest/) to obtain metrics and stores them in a metrics.json file. Although the script section is executed and I can download the…
0
votes
0 answers

CKJM tool metrics not meeting the expectation

I used ckjm metrics tool for generating metrics on java class files.The metric values which it generated is not correct while checking manually.Please let me know,is anyone facing similar issue. I ran ckjm metrics tool for generating metrics on java…
0
votes
0 answers

how to extract code metrics and compare quality of a code?

I need to do a software architecture research and for that I need to extract code metrics. At first they would be projects only in Python and JavaScript. I would like suggestions for good tools to extract these metrics. In Python I found radon. I…
0
votes
0 answers

Can I change the codemetrics VSCode Extension to score jest test arrow functions differently?

The VSCode extension codemetrics provides a "close approximation of cyclomatic complexity." However it keeps flagging up my describe and it arrow function blocks in jest tests are overly complex. I haven't found a setting for treating these…
AncientSwordRage
  • 7,086
  • 19
  • 90
  • 173
0
votes
1 answer

What is 'Assignment Branch Condition Size too high' and how to fix it?

In my Rails app, I tried to run Rubocop to check for problems. It gave me an error like this : Assignment Branch Condition size for show is too high. Here's my code : def create @field =…
0
votes
4 answers

Which tools indicate pairs of highly-coupled Java classes?

I'm aware of a few tools that indicate which individual classes are coupled to many other classes. For example, several tools implement Coupling Between Objects (CBO), which tells which classes are coupled to many other classes. (For a class CBO…
kc2001
  • 5,008
  • 4
  • 51
  • 92
0
votes
1 answer

Guidelines for permissible maximum linearly-independent cyclomatic complexity?

For software engineering metrics, what are some guidelines on the maximum permissible linearly-independent cyclomatic complexity? For a properly designed module, what is the upper-bound on cyclomatic complexity?
Eugene
  • 10,957
  • 20
  • 69
  • 97
0
votes
1 answer

How to use multimetric python library for calculating code parameters?

I am working on project which deals with calculation of halsted matrix and mccabe cyclomatic complexity for the codes in various languages. I found this library multimeric but its documentation is not intuitive. Please explain to me how to use this…
0
votes
1 answer

How does radon calculate cycloMatic complexity of a class?

I ran radon cc -s myFile.py to calculate Cyclo metrics for it, I have pasted part of the result below ... (more stuff) C 37:0 MyClass - A (3) M 40:4 MyClass.letter - A (2) M 47:4 MyClass.fullname - A (2) M 58:4 MyClass.__str__ - A (1) ... (more…
95_96
  • 341
  • 2
  • 12
0
votes
0 answers

How to get low cyclomatic complexity with switch statements?

I have a function that takes an input and does a switch case based on a specific input property. So the function itself is pretty simple, as you can see below function handleMessage(message) { switch (message.type) { case "a": …
Jimi
  • 1,605
  • 1
  • 16
  • 33
0
votes
2 answers

How to get the length of a identifier/method in C#?

I'm trying to get the length of all the identifiers and methods of a project made in ASP.NET Core 2.2, in order to analize the code metrics for a homework, but I haven't found any kind of tool that provides that metric. By far I've used Code Metrics…
0
votes
0 answers

How to find and count the patterns of indentation within some specific comments in Java

Let's say, within a single file, I have the following java code: //#if defined(LOGGING) 4 static { 8 if (System.getProperty(ARGO_CONSOLE_SUPPRESS) != null) { 12 …
Avah
  • 227
  • 3
  • 13
0
votes
1 answer

GNAT Metric and RTL files

For running GNAT metric (for Windows, GPL 2017 or CE 2018) I'd like to include the RTL sources as well. There is a "-a" switch but it seems to be ineffective. When I'm forcing visibility of RTL sources, only ada.ads and system.ads are processed.…
Zerte
  • 1,478
  • 10
  • 9