Death Note and Code Gayass are both nothing more than mindgames. This seems good in theory but when it's all you have going for you it ultimately amounts to very little. In a TV series or a really long movie, if you do one of the same thing for too long the audience will become tired or bored of it and eventually stop caring about what they're watching. There needs to be breaks in the series from the usual monotony, even if you need to step away from the main story to do it.
There are three basic genres for most films, TV series, or anime - action, drama, and comedy - and the best way to take a break from one of the genres for a little while is to do an episode that falls into another genre. Comedy anime need the breaks the least of these, although the occasional dramatic episode can provide character development and potentially set up for future jokes. It's also very difficult for comedy anime to pull off an action episode unless they're nonsense anime (Excel Saga, Bobobo) or it's inherent to the comedic style like in physical comedy (Bludgeoning Angel Dokuro-chan). Slice-of-life comedies have a much more difficult time incorporating action into their repertoire, so this usually manifests itself in a trip to the beach or a field day to do some physical comedy (Azumanga Daioh has both of these).
Action can pull off both dramatic episodes and comedic episodes fairly easily. Dramatic episodes can deal with the characters' personal feelings and develop them into more than just a faceless fighter. Comedy episodes can take a break from the intense action and draw comedy from putting them in situations that they're not used to (
Men in pink, how bizarre).
Drama anime are the ones that need to take breaks most since the audience can grow weary of the characters and storyline if they're not extremely well written. Look at Cowboy Bebop. There are many episodes with elaborate chase scenes and gunfights (action) but there are also episodes that deal with comedic themes (like when they had a mutant ooze living in their refrigerator or when they all got high on mushrooms). When done properly, taking a break from the main genre of the anime can be very refreshing to the viewer and enhance the experience overall.
When Death Note does attempt something besides mindgames, it fails miserably. Death Note has almost no action aside from a rare gunshot or something. Action in Death Note is, ultimately, someone writing names in a book, which only seems cool because of the series' ridiculously high production values. And really, good production values can make anything seem entertaining (look at 75% of every game on current gen consoles that has a metacritic rating above 80 and every movie released since 2000 that grossed more than $100,000,000). If Death Note had the animation quality of, say, Dragonball, the "action" scenes would be boring as ****.
As far as comedy goes, the comedic relief character, Misa Misa (or whatever her name is - the blonde one who turns out to have a Death Note WHAT A TWIST) is one of the most annoying, obnoxious, vapid, insufferable abominations to ever torture an anime fan. This girl is to Death Note what Jar Jar Binks is to Star Wars. She ultimately serves no purpose in the storyline than to attempt to provide minor amounts of humor and stalk Light (nice character names btw, naming themselves after English words and letters of the alphabet is SOOO COOOL). She fails catastrophically.
So what we're ultimately left with in Death Note is a drama with action sequences that are incredibly lame when you think about it logically and an annoying blonde parasite that even fans of the series hate. Death Note lives almost exclusively on its plot twists and production values - It's like the anime equivalent of MGS4, only instead of an awesome manly main character we get an emo kid who eventually turns into a sociopath.
Code Geass doesn't even try to be anything but drama. From what I've seen of the series there is almost no comedy whatsoever, which almost always leaves you with something that takes itself too seriously. The only thing that can be considered remotely comedic is the scene with Karin in the bunny suit, and that's more blatant fanservice than comedy.
It has more action than Death Note, but only because it uses the most generic, bland, obvious method of inserting action into your anime ever - mecha. For the longest time I could not for the life of me figure out why Code Geass had mecha when they weren't the focus of the story, their energy supply wasn't a major concern, and there was almost no explanation for the history of them whatsoever (including the obvious question of how a robot that big and well armored isn't too heavy to move). In other mecha anime, it's clearly explained that mecha are, in fact, a big deal.
Gurren Lagann, Evangelion, and many Gundam series explore this aspect of having giant robots. In Evangelion the mecha, EVAs, are technology stolen from "God" or something (which is a lame cop-out but it's better than nothing), they run on a power cord, and there's even an episode devoted to another country building an Eva unit with a portable nuclear power source. Additionally, the pilots are also carefully selected and in Rei's case even created, something that carries onto other mecha anime like Gundam SEED where pilots are genetically engineered. In Gurren Lagann, the mecha, Ganmen, are technology from the Beastman species that rules the planet and they're powered by the pilot's will to fight (which is the only thing strong enough to move them).
G-Gundam is set in the far future, where they presumably have the technology to maintain (or even power) the gundams, and it's explained that there are few more than 1 Gundam per each major superpower (Japan, China, America, Russia, etc.), each pilot has a unique fighting style (American boxer, Russian grappler, Chinese woman, Indian guy who can stretch his arms really far, Brazilian feral child, Hakan, etc.), as well as a very large support team, and they hold a tournament once in a while for...lulz basically (the last tournament was hosted by M. Bison to see which Gundam would be best suited to his new body, but then Akuma showed up in the Dark Gundam and performed the Raging Demon on him and he was killed until G-Gundam IV when Neo-Shadaloo brought him back to life). G-Gundam does a good job of not only characterizing the protagonist and being entertaining but also explaining almost everything that goes on in its universe (though one thing it doesn't explain fully is how
that hand of his glows with an awesome POWERRR! or why its burning grip tells him who to defeat but whatever).
In all of these mecha anime, the concept of having giant robots is explained in varying amounts of depth. In Code Geass, however, it's not.
The mecha in Code Geass are there to make the action scenes more exciting, or rather, to create action scenes. They're not explained as to how they can perform at maximum efficiency without being away from a power source, why that have completely replaced tanks, APCs, and aircraft in the armed forces, or how long they've been around. The only purpose the mecha serve is to break up the drama with more action, but they neglect to explain it at all because what's more entertaining to watch - normal looking tanks and soldiers like we have in present day or awesome futuristic impractical giant robots? It's like the part with the jungle mutants in Uncharted - the creators of the game didn't explain it at all, they just wanted variety in enemy types.
The creators of Code Geass are basically saying "we don't have to explain why there are giant robots to the viewers, we can just put them in because they look cool". It's up there with fanservice and
moe as one of the cheapest cop-outs you can do to get people to pay attention to your show or movie.
That is why Death Note and Code Geass are overrated. They have good ideas and are solid dramas but they take themselves too seriously and can't come up with any way to break the monotony of each episode than to use some of the oldest tropes in the history of anime and hope that the ludicrously high production values distract from the flaws.
tl;dr - Death Note and Code Gayass are for people who are easily amused by plot twists and shiny objects and there are a million better things you could be watching.