Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: configure nimalyzer #74

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

vil02
Copy link
Member

@vil02 vil02 commented May 5, 2024

In this PR I propose to use nimalyzer as a static analysis tool for this repository. I add a workflow nimalyzer.yml and a config file .nimalyzer.cfg. Please notice that some of the rules are temporarily commented out (with having them in, the check would simply fail). I suggest to create a issue, where we can discuss which rules to activate and trace the progresses of fixing the warnings.

The config file is a simplified version of the official example. All of the nim-files are the object of the analysis.

Please notice that nimalyzer.yml will run one per week. Due to the fact that the tool is still under development, I think it would be a good idea to know early enough if something breaks or changes.

Related to #16.

@vil02 vil02 marked this pull request as ready for review May 5, 2024 09:52
@dlesnoff
Copy link
Collaborator

dlesnoff commented Jul 8, 2024

I am sorry for my very late reaction.

It seems too early for me to integrate nimalyzer.
I think it would be better to wait a little bit before incorporating it.
I'll check locally the output of nimalyzer.

EDIT: I ran nimalyzer on the repository:
Below is the output of nimalyzer after changing some options to adapt the configuration file for v.0.9:

[11:37:32] INFO   Starting nimalyzer ver 0.9
[11:37:32] INFO   [1/29] Parsing 'backtracking/nagel_schrekenberg.nim'
[11:37:32] ERROR  rule: params, procedure constructHighway* line: 27 parameter 'randomFrequency' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure constructHighway* line: 27 parameter 'randomSpeed' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure getDistance* line: 41 parameter 'highwayNow' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure update* line: 56 parameter 'highwayNow' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure update* line: 56 parameter 'probability' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure simulate* line: 73 parameter 'highway' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure simulate* line: 73 parameter 'probability' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   [2/29] Parsing 'dynamic_programming/catalan_numbers.nim'
[11:37:32] ERROR  rule: params, procedure catalanNumbersRecursive line: 17 parameter 'index' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure catalanNumbersRecursive2 line: 28 parameter 'index' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure catalanNumbers line: 34 parameter 'indexLimit' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure catalanNumbers2 line: 42 parameter 'index' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure catalanNumbersIt line: 47 parameter 'index' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure createCatalanTable line: 56 parameter 'index' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure catalanNumbersCompileTime line: 65 parameter 'index' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   [3/29] Parsing 'dynamic_programming/fibonacci_numbers.nim'
[11:37:32] ERROR  rule: params, procedure fibonacciRecursive* line: 39 parameter 'nth' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure fibonacciSeqIterative* line: 49 parameter 'n' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure fibonacciClosedFormApproximation* line: 62 parameter 'nth' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure fibonacciClosure* line: 85 parameter 'nth' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure fibonacciSeqClosure* line: 93 parameter 'n' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure fibonacciIterator* line: 103 parameter 's' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure `*` line: 120 parameter 'm1' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure `*` line: 120 parameter 'm2' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure pow line: 129 parameter 'matrix' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure pow line: 129 parameter 'n' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure fibonacciMatrix* line: 141 parameter 'nth' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   [4/29] Parsing 'dynamic_programming/levenshtein_distance.nim'
[11:37:32] ERROR  rule: params, procedure initLevenshteinDistanceMatrix line: 16 parameter 'lenA' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure initLevenshteinDistanceMatrix line: 16 parameter 'lenB' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure fillLevenshteinDistanceMatrix line: 27 parameter 'distances' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   [5/29] Parsing 'dynamic_programming/viterbi.nim'
[11:37:32] ERROR  rule: params, procedure viterbi* line: 11 parameter 'hmm' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure viterbi* line: 11 parameter 'observations' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   [6/29] Parsing 'graphics/bresenhams_line.nim'
[11:37:32] ERROR  rule: params, procedure drawBresenhamLine* line: 8 parameter 'posA' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure drawBresenhamLine* line: 8 parameter 'posB' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   [7/29] Parsing 'graphs/dijkstra_backtracking.nim'
[11:37:32] ERROR  rule: params, procedure addVertex line: 12 parameter 'g' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addVertex line: 12 parameter 'vertex' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addEdge line: 17 parameter 'g' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addEdge line: 17 parameter 'source' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addEdge line: 17 parameter 'destination' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure dijkstraWithPath line: 22 parameter 'g' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure dijkstraWithPath line: 22 parameter 'startNode' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure dijkstraWithPath line: 22 doesn't use parameter 'targetNode'.
[11:37:32] ERROR  rule: params, procedure dijkstraWithPath line: 22 parameter 'targetNode' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure constructPath line: 49 parameter 'parent' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure constructPath line: 49 parameter 'startNode' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure constructPath line: 49 parameter 'targetNode' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   [8/29] Parsing 'graphs/graph_adjacency_list_undirected.nim'
[11:37:32] ERROR  rule: params, procedure addVertex line: 10 parameter 'g' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addVertex line: 10 parameter 'vertex' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addEdge line: 14 parameter 'g' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addEdge line: 14 parameter 'source' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addEdge line: 14 parameter 'destination' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure printGraph line: 22 parameter 'g' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   [9/29] Parsing 'graphs/graph_bellman_ford.nim'
[11:37:32] ERROR  rule: params, procedure addVertex line: 12 parameter 'g' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addVertex line: 12 parameter 'vertex' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addEdge line: 15 parameter 'g' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addEdge line: 15 parameter 'source' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addEdge line: 15 parameter 'destination' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure bellmanFord line: 18 parameter 'g' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure bellmanFord line: 18 parameter 'startNode' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   [10/29] Parsing 'graphs/graph_bfs.nim'
[11:37:32] ERROR  rule: params, procedure addVertex line: 10 parameter 'g' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addVertex line: 10 parameter 'vertex' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addEdge line: 14 parameter 'g' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addEdge line: 14 parameter 'source' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addEdge line: 14 parameter 'destination' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure bfs line: 18 parameter 'g' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure bfs line: 18 parameter 'startNode' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure bfs line: 18 parameter 'visited' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure bfs line: 18 parameter 'action' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   [11/29] Parsing 'graphs/graph_dfs.nim'
[11:37:32] ERROR  rule: params, procedure addVertex line: 10 parameter 'g' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addVertex line: 10 parameter 'vertex' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addEdge line: 14 parameter 'g' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addEdge line: 14 parameter 'source' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addEdge line: 14 parameter 'destination' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure dfs line: 18 parameter 'g' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure dfs line: 18 parameter 'startNode' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure dfs line: 18 parameter 'visited' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure dfs line: 18 parameter 'action' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   [12/29] Parsing 'graphs/graph_dijkstra.nim'
[11:37:32] ERROR  rule: params, procedure addVertex line: 12 parameter 'g' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addVertex line: 12 parameter 'vertex' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addEdge line: 17 parameter 'g' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addEdge line: 17 parameter 'source' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addEdge line: 17 parameter 'destination' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure dijkstra line: 22 parameter 'g' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure dijkstra line: 22 parameter 'startNode' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   [13/29] Parsing 'graphs/graph_eulerian_path_fleury_algorithm.nim'
[11:37:32] ERROR  rule: params, procedure addEdge line: 6 parameter 'graph' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure removeEdge line: 17 parameter 'graph' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure fleury line: 21 parameter 'graph' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure eulerianPathUtil line: 51 parameter 'u' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   [14/29] Parsing 'graphs/graph_floyd_warshall.nim'
[11:37:32] ERROR  rule: params, procedure addVertex line: 12 parameter 'g' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addVertex line: 12 parameter 'vertex' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addEdge line: 25 parameter 'g' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addEdge line: 25 parameter 'source' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addEdge line: 25 parameter 'destination' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure addEdge line: 25 parameter 'weight' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure floydWarshall line: 29 parameter 'g' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure floydWarshall line: 29 parameter 'threshold' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   [15/29] Parsing 'graphs/graph_kruskal_algorithm.nim'
[11:37:32] ERROR  rule: params, procedure findRoot line: 19 parameter 'ds' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure unionSets line: 28 parameter 'ds' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure kruskal line: 35 parameter 'graph' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   [16/29] Parsing 'graphs/graph_parsing_dot.nim'
[11:37:32] ERROR  rule: params, procedure addNodeToGraph line: 13 parameter 'graph' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   [17/29] Parsing 'graphs/graph_prim_algorithm.nim'
[11:37:32] ERROR  rule: params, procedure prim line: 6 parameter 'graph' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   [18/29] Parsing 'graphs/nimgraphviz_example.nim'
[11:37:32] INFO   [19/29] Parsing 'maths/abs.nim'
[11:37:32] ERROR  rule: params, procedure absVal* line: 12 parameter 'num' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure absVal* line: 18 parameter 'num' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure absMin* line: 20 parameter 'x' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure absMax* line: 30 parameter 'x' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure signedMinAbs* line: 40 parameter 'x' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure signedMaxAbs* line: 52 parameter 'x' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   [20/29] Parsing 'maths/aliquot_sum.nim'
[11:37:32] ERROR  rule: params, procedure aliquotSum* line: 14 parameter 'number' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   [21/29] Parsing 'maths/arc_length.nim'
[11:37:32] ERROR  rule: params, procedure arcLengthDegree line: 6 parameter 'radius' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure arcLengthDegree line: 6 parameter 'angle' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure arcLengthRadian line: 10 parameter 'radius' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure arcLengthRadian line: 10 parameter 'angle' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   [22/29] Parsing 'maths/area.nim'
[11:37:32] ERROR  rule: params, procedure surfaceAreaCube line: 3 parameter 'sideLength' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure surfaceAreaCuboid line: 9 parameter 'length' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure surfaceAreaCuboid line: 9 parameter 'breadth' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure surfaceAreaCuboid line: 9 parameter 'height' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure surfaceAreaHemisphere line: 15 parameter 'radius' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure surfaceAreaCone line: 18 parameter 'radius' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure surfaceAreaCone line: 18 parameter 'height' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   [23/29] Parsing 'maths/bitwise_addition.nim'
[11:37:32] INFO   [24/29] Parsing 'maths/extended_gcd.nim'
[11:37:32] INFO   [25/29] Parsing 'maths/modular_inverse.nim'
[11:37:32] ERROR  rule: params, procedure euclidHalfIteration line: 6 parameter 'inA' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure euclidHalfIteration line: 6 parameter 'inB' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure modularInverse* line: 16 parameter 'modulus' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   [26/29] Parsing 'searches/binary_search.nim'
[11:37:32] ERROR  rule: params, procedure binarySearchIterative* line: 38 parameter 'arr' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure binarySearchIterative* line: 38 parameter 'key' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure binarySearchRecursive line: 60 parameter 'arr' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure binarySearchRecursive line: 60 parameter 'left' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure binarySearchRecursive line: 60 parameter 'right' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure binarySearchRecursive line: 60 parameter 'key' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure binarySearchRecursive* line: 78 parameter 'arr' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure binarySearchRecursive* line: 78 parameter 'key' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   [27/29] Parsing 'searches/linear_search.nim'
[11:37:32] ERROR  rule: params, procedure linearSearch* line: 35 parameter 'arr' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure linearSearch* line: 35 parameter 'key' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure recursiveLinearSearch* line: 45 parameter 'arr' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure recursiveLinearSearch* line: 45 parameter 'key' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure recursiveLinearSearch* line: 45 parameter 'idx' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   [28/29] Parsing 'stable_marriage/gale_shapley.nim'
[11:37:32] ERROR  rule: params, procedure randomPair line: 91 parameter 'max' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure perturbPairs line: 98 parameter 'ms' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure swap line: 103 parameter 'arr' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure str line: 107 parameter 'c' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure str line: 107 parameter 'aNames' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure str line: 107 parameter 'bNames' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure checkPairStability line: 110 parameter 'matches' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure checkPairStability line: 110 parameter 'recipientPrefs' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure checkPairStability line: 110 parameter 'contenderPrefs' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure render line: 121 parameter 'contMatches' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure render line: 121 parameter 'cNames' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure render line: 121 parameter 'rNames' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure checkStabilityAndLog line: 129 parameter 'matches' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure checkStabilityAndLog line: 129 parameter 'perturb' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure initContenderPrefs* line: 160 parameter 'prefs' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure initContenderPrefs* line: 160 parameter 'rNames' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure initRecipientPrefs* line: 169 parameter 'prefs' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure initRecipientPrefs* line: 169 parameter 'cNames' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure invertPrefs* line: 177 parameter 'prefs' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure stableMatching* line: 187 parameter 'contenderPrefs' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure stableMatching* line: 187 parameter 'recipientPrefs' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure match line: 209 parameter 'c' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure match line: 209 parameter 'r' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure checkMatchingStability* line: 230 parameter 'matches' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure checkMatchingStability* line: 230 parameter 'contenderPrefs' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure checkMatchingStability* line: 230 parameter 'recipientPrefs' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   [29/29] Parsing 'strings/check_anagram.nim'
[11:37:32] ERROR  rule: params, procedure toLowerUnchecked line: 50 parameter 'c' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure normalizeChar line: 62 parameter 'c' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure isAnagram* line: 70 parameter 'wordA' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure isAnagram* line: 70 parameter 'wordB' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure isAnagram line: 86 parameter 'candidate' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure isAnagram line: 86 parameter 'wordNormalized' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure isAnagram line: 86 parameter 'wordMap' doesn't use int or string as type.
[11:37:32] ERROR  rule: params, procedure filterAnagrams* line: 104 parameter 'candidates' doesn't use int or string as type.
[11:37:32] ERROR  Explanation: Unused parameters only clutter the source code and can cause confusion.
[11:37:32] INFO   ========
[11:37:32] INFO   SUMMARY:
[11:37:32] INFO   Time elapsed: 00.027 sec(s)
[11:37:32] INFO   Max memory usage: 00.504 MiB
[11:37:32] INFO   Stopping nimalyzer.

.nimalyzer.cfg Outdated Show resolved Hide resolved
.nimalyzer.cfg Outdated Show resolved Hide resolved
.nimalyzer.cfg Outdated Show resolved Hide resolved
.nimalyzer.cfg Outdated Show resolved Hide resolved
@vil02
Copy link
Member Author

vil02 commented Jul 15, 2024

1f7a2d0 is similar to #78.

Regarding the early stage of nimalyzer: are there some alternative tools? I would use it as long as it would not enforce some strange workarounds. We could also pin the version by installing it with a command like

nimble install nimalyzer@0.9 -y

@dlesnoff
Copy link
Collaborator

The output of nimanalyzer is strange:
"[11:37:32] ERROR rule: params, procedure constructHighway* line: 27 parameter 'randomFrequency' doesn't use int or string as type."
I don't understand the "doesn't use int or string as type.". I understand from it that the nimanalyzer tool doesn't support finding unused parameters if there are not of these types.

I don't know any alternatives for this kind of tool.

@dlesnoff
Copy link
Collaborator

Re-read the documentation of Nim analyzer, there is a bug with the rule:
"check params used all".

Doc: https://www.laeran.pl.eu.org/repositories/nimalyzer/wiki?name=paramsUsed%20rule
Since both checkType and declarationType may use the keyword "all", there might be a parser error here, that replaces "used" by "all" for the checkType (when the "all" is actually a declarationType thing). I'll open an issue in the Fossil repository if I manage that.

@dlesnoff dlesnoff self-assigned this Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants