Use this tag when question related to unused variables issues as warnings
Questions tagged [unused-variables]
179 questions
0
votes
0 answers
Weird behavior unused argument in function R
I implemented a function 'identify_case' i.e.:
## Function that identify the gaps of NAs according to their length
identify_case = function(df, variable, seuil) {
df$value = ifelse(is.na(df[,variable])==TRUE,1,0)
df$temp =…

Amandine.G
- 181
- 1
- 2
- 9
0
votes
1 answer
Alternative to static blocks without unused variable
As an alternative to static blocks, Oracle docs are suggesting to call a method(s) and the example is using a variable assignment:
public static varType myVar = initializeClassVariable();
The advantage of private static methods is that they can be…

Ori Marko
- 56,308
- 23
- 131
- 233
0
votes
1 answer
Convention for cell-local variables in R markdown
I often have variables in cells that I do not need again. Say a loop index or just an intermediate result. These build up in the list of variables in RStudio, and it does not make it easier to work with.
Therefore I would like to mark those “cell…

Martin Ueding
- 8,245
- 6
- 46
- 92
0
votes
0 answers
Is there any simple way to find out unused Drawable file ,layout and Classes in Kotlin?
I have a huge Android project Done with Kotlin . and have many drawable file,Classes and layouts. I wanted to remove unused drawable file,classes and layouts.
Is there any easy way to do so?
user8782177
0
votes
1 answer
Disable "Unused variable" for ScopedGuard
Im playing with Andrei Alexandrescu and Petru Marginean scoped guard object
When you compile it with -Wall -Werror you get "unused variable" error. The following code is taken from LOKI
class ScopeGuardImplBase
{
ScopeGuardImplBase&…

Peretz Levinov
- 1
- 1
- 1
0
votes
1 answer
Which files? Which subroutines?
I have a Fortran project comprising around 100 files. All of them are compiled but not all of them are needed for a run. Also some files contain a mix of used / unused subroutines.
Is there a way to know the minimum set of files / subroutines /…

Manfredo
- 1,760
- 4
- 25
- 53
0
votes
1 answer
error: unused parameter 'tile'
I tried everything and my Game of Fifteen is one error away from being compiled.
The only issue is that somehow I get the "unused parameter error", telling me that my code does not make use of the tile parameter...which it should!
Here's the…

Tytire Recubans
- 967
- 10
- 27
0
votes
3 answers
Why do I get this compiler warning?
I am trying to get a list of the longest words from each line in a block of text. I cant get the information to print from my main which is in processing.class. The information is processed in Tools.class. and there is also a Counters.class that is…

Onkar Deol
- 1
- 2
0
votes
0 answers
windows script to list unused #define constant definitions in a C project
I am a newbie to creating scripts. I am working in a C language based software project. One of the problems is that there are a lot of unused #define constant definitions in the project and I have created a windows script to find the unused #defines…

AGLakshmanan
- 26
- 5
0
votes
1 answer
JQuery Unused Variable Error
I have a script to populate data from database but the variable i'm trying to use variable selected seems to not being used. What I mean by that is Netbeans is telling me that the variable is unused. Is there something wrong with the…

World Outside
- 15
- 4
0
votes
1 answer
Why does my program on C not run and give me unused variable error?
I'm writing a program that adds the numbers from 1-5 and prints out the sum. It was working a week ago but today I got unused variable error and don't know where i'm wrong.
int main(int argc, const char * argv[]) {
int sum = 0;
int num;
…

J.Doe
- 29
- 4
0
votes
0 answers
Why is this utilized variable grayed out?
I have two local vars with the same raison d'etre, _lastShortName and _lastCompanyName :
private string _lastShortName = String.Empty;
private string _lastCompanyName = String.Empty;
...which are used like this:
private void…

B. Clay Shannon-B. Crow Raven
- 8,547
- 144
- 472
- 862
0
votes
2 answers
Trying to create a basic Binary Search Tree in C but confused about 'unused variable'?
Created a basic binary search tree, utilising linkedlists AND also trying to input 'data' into the function (because it requires it).
However, I keep getting the 'unused variable' error even though I'm using it?
Is it because I'm not returning…

BartTheProgrammer
- 21
- 3
0
votes
1 answer
How does IDE knows unused import and functions
What is the mechanism of IDE like IntelliJ, Android Studio and Eclipse, etc. detects unused imports, variables and functions?
Also, We don't have to manually "save" in IntelliJ, what happens every time I edit something in this kind of IDE?
Thanks!

Andro Chen
- 83
- 1
- 5
0
votes
1 answer
How to fix thrown error "unused assigned value" to use the actual value?
Beginner here. So here a sample of my code for you to stalk:
/// if addToCart action is called
if (userPath.equals("/addToCart")) {
// if user is adding item to cart for first time
// create cart object and attach it to user session
if…