"Too many errors. (91% scanned)."

The yellow triangle is shown on an empty line. The project runs fine. Is this a bug?

Yellow triangles are just a warning and can usually be ignored. If you hover over it, the warning message should appear.

I have seen that before. Is there another error anywhere? If so fix that first.

If that is the only error then there is probably a catastrophic syntax error in your program somewhere. Javascript is a multi-scan compiler so it could be anywhere. Look for unmatched {, [, and ".

One way to find it is to comment out large sections of code then uncomment it in small sections until you find the spot that is causing the problem. Use /* and */ to start and end comment section easily.

Exactly, the title is the error message, and it makes no sense.

Nope, its position shifts to seemingly random line everytime my student access the project, and the XX% changes every time.
In this particular case, the code is

function repeatChar(char,times){
 var myStr = "";
 for(var i = 0; i<times; i++){
 myStr = myStr+char;
 }
 return myStr; //triangle is on this line
} 

It really makes no sense, there are only 4 errors in his +3500 line program, none being critical.

Alas, he said everything works fine anyways… and I know how hard it is to debug in applab’s UI without any accurate warning, especially given his code’s length.

The yellow triangle is not where the problem is. It actually has nothing to do with the real problem. If there are other yellow triangles or red squares eliminate those first.

What is happening is there are either many errors that have been cut and paste all over the program or a single unbalanced bracket. With 3500 lines I am guessing the former.

Create a new project and move the code into it a page at a time until the compiler tells you where the real problem is.

Alrightie I will “suggest” him to go debug, perhaps one part at a time (don’t want to cross the CollegeBoard line lol)
Thanks for your help!

Hi again, so I remixed my student’s project and I play around the
// jshint maxerr:xxx
Something weird happened - if I set the number to 1, the first line - a var declaration - is flagged as “too many errors”, same goes all the way to 100.
When I set it to 5000, every warning in the program showed up correctly - there’s about 7 of them, mainly creating functions within loops - I told my student not to do that before, but he told me those functions will only be executed a few times, by design.
Could this be the reason?

It is not a Javascript error to put a function definition into a loop, just a warning from App Lab. However if you do that enough times you will exceed the number of errors and warnings you are allowed before it quits looking at them.

Take those functions out of the loop, name them and use them in the loop as named functions. If you need to create a closure then create a function that returns a function outside the loop. If you don’t know what a closure is you probably are not using one.

Then see if you have any more errors and warnings.

Hello,

It is highly possible that this is the problem. Every time they define a function in a loop they are creating a new function and creating that app lab warning message. Its not a question of how many times they will be executed, but how many times they will be created. @jdonwells is right that your student is likely exceeding the number of warnings in the loop and thus any other warnings/errors are being ignored or suppressed.

Beyond sharing the suppressed warning issue fact with the student though, I would let this go - this is the time for your student to solve his/her own problems! The issue of the warnings is about the programming language and I would be fine sharing that with the kids. Remixing a students work, identifying where the issue is, and sharing that issue (or sharing the fix) is sharing information about the student code and would cross the ‘CollegeBoard line’. It’s tough to see them struggle, but I personally would not feel comfortable sharing.

Indeed seeing them struggle on sometimes a single line of code is hard enough, let alone not helping. But it felt so good - both for me and them - when it finally works.
Just gonna let them go through this process on their own :wink: For me, the most important aspect of coding is debug and its process - not the final product.