question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Complex if() freezes analysis

See original GitHub issue

Trying to analyze the following, rather complex, if() statement will freeze analysis. No error or anything, just hanging there until manually killed.

component {
  function foo() {
    if (keys[i] == sectionActionsName && !loadSectionFreeSkills && !loadSectionActions && !loadSectionActionsContact && !loadSectionActionsHistory && !loadSectionComment
        || keys[i] == sectionProfileName && !loadSectionProfile
        || keys[i] == sectionLanguagesName && !loadSectionLanguages
        || keys[i] == sectionExperienceWidgetName && !loadSectionProfile && !loadSectionExperience
        || keys[i] == sectionProfileName && !loadSectionProfile
        || keys[i] == sectionExperienceName && !loadSectionExperience
        || keys[i] == sectionSkillsName && !loadSectionSkills
        || keys[i] == sectionFreeSkillsName && !loadSectionFreeSkills
        || keys[i] == sectionFunctionsName && !loadSectionFunctions
        || keys[i] == sectionEducationName && !loadSectionEducation
        || keys[i] == sectionAttachmentName && !loadSectionAttachment
    ) {
        // do something
    }
  }
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
jevans-gpcommented, May 2, 2017

that’s terrible code, as a human i freeze reading it.

1reaction
ryaneberlycommented, Jun 17, 2017

This is fixed in cfparser 2.4.6 (coming to maven soon)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Find the Cause of a UI Freeze | dotTrace Documentation
For example, all controls from the Analysis Subject filter were moved under ... The algorithm of fixing UI freezes shown in this tutorial ......
Read more >
Code Freeze in Software Engineering - GeeksforGeeks
Code Freeze is one type of freeze among the three types of freeze i.e. specification freeze, feature freeze and code freeze.
Read more >
13.8: Freezing-Point Depression and Boiling-Point Elevation ...
A solution of 4.00 g of a nonelectrolyte dissolved in 55.0 g of benzene is found to freeze at 2.32 °C. What is...
Read more >
How to freeze nested objects in javascript? - Stack Overflow
freeze() function. It seems to be a pretty good feature but how to make whole object (including nested objects) immutable? For example I...
Read more >
Nested for-loop freezing Unity - Unity Answers
If it still feels stuck, then your design has a performance flaw. Either make the loops smaller, or do them only once in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found