Search This Blog

Sunday, November 12, 2023

Code refactoring

From Wikipedia, the free encyclopedia
https://en.wikipedia.org/wiki/Code_refactoring

In computer programming and software design, code refactoring is the process of restructuring existing computer code—changing the factoring—without changing its external behavior. Refactoring is intended to improve the design, structure, and/or implementation of the software (its non-functional attributes), while preserving its functionality. Potential advantages of refactoring may include improved code readability and reduced complexity; these can improve the source code's maintainability and create a simpler, cleaner, or more expressive internal architecture or object model to improve extensibility. Another potential goal for refactoring is improved performance; software engineers face an ongoing challenge to write programs that perform faster or use less memory.

Typically, refactoring applies a series of standardized basic micro-refactorings, each of which is (usually) a tiny change in a computer program's source code that either preserves the behavior of the software, or at least does not modify its conformance to functional requirements. Many development environments provide automated support for performing the mechanical aspects of these basic refactorings. If done well, code refactoring may help software developers discover and fix hidden or dormant bugs or vulnerabilities in the system by simplifying the underlying logic and eliminating unnecessary levels of complexity. If done poorly, it may fail the requirement that external functionality not be changed, and may thus introduce new bugs.

By continuously improving the design of code, we make it easier and easier to work with. This is in sharp contrast to what typically happens: little refactoring and a great deal of attention paid to expediently add new features. If you get into the hygienic habit of refactoring continuously, you'll find that it is easier to extend and maintain code.

— Joshua Kerievsky, Refactoring to Patterns

Motivation

Refactoring is usually motivated by noticing a code smell. For example, the method at hand may be very long, or it may be a near duplicate of another nearby method. Once recognized, such problems can be addressed by refactoring the source code, or transforming it into a new form that behaves the same as before but that no longer "smells".

For a long routine, one or more smaller subroutines can be extracted; or for duplicate routines, the duplication can be removed and replaced with one shared function. Failure to perform refactoring can result in accumulating technical debt; on the other hand, refactoring is one of the primary means of repaying technical debt.

Benefits

There are two general categories of benefits to the activity of refactoring.

  1. Maintainability. It is easier to fix bugs because the source code is easy to read and the intent of its author is easy to grasp. This might be achieved by reducing large monolithic routines into a set of individually concise, well-named, single-purpose methods. It might be achieved by moving a method to a more appropriate class, or by removing misleading comments.
  2. Extensibility. It is easier to extend the capabilities of the application if it uses recognizable design patterns, and it provides some flexibility where none before may have existed.

Performance engineering can remove inefficiencies in programs, known as software bloat, arising from traditional software-development strategies that aim to minimize an application's development time rather than the time it takes to run. Performance engineering can also tailor software to the hardware on which it runs, for example, to take advantage of parallel processors and vector units.

Challenges

Refactoring requires extracting software system structure, data models, and intra-application dependencies to get back knowledge of an existing software system. The turnover of teams implies missing or inaccurate knowledge of the current state of a system and about design decisions made by departing developers. Further code refactoring activities may require additional effort to regain this knowledge. Refactoring activities generate architectural modifications that deteriorate the structural architecture of a software system. Such deterioration affects architectural properties such as maintainability and comprehensibility which can lead to a complete re-development of software systems. 

Code refactoring activities are secured with software intelligence when using tools and techniques providing data about algorithms and sequences of code execution. Providing a comprehensible format for the inner-state of software system structure, data models, and intra-components dependencies is a critical element to form a high-level understanding and then refined views of what needs to be modified, and how.

Testing

Automatic unit tests should be set up before refactoring to ensure routines still behave as expected. Unit tests can bring stability to even large refactors when performed with a single atomic commit. A common strategy to allow safe and atomic refactors spanning multiple projects is to store all projects in a single repository, known as monorepo.

With unit testing in place, refactoring is then an iterative cycle of making a small program transformation, testing it to ensure correctness, and making another small transformation. If at any point a test fails, the last small change is undone and repeated in a different way. Through many small steps the program moves from where it was to where you want it to be. For this very iterative process to be practical, the tests must run very quickly, or the programmer would have to spend a large fraction of their time waiting for the tests to finish. Proponents of extreme programming and other agile software development describe this activity as an integral part of the software development cycle.

Techniques

Here are some examples of micro-refactorings; some of these may only apply to certain languages or language types. A longer list can be found in Martin Fowler's refactoring book and website. Many development environments provide automated support for these micro-refactorings. For instance, a programmer could click on the name of a variable and then select the "Encapsulate field" refactoring from a context menu. The IDE would then prompt for additional details, typically with sensible defaults and a preview of the code changes. After confirmation by the programmer it would carry out the required changes throughout the code.

  • Techniques that allow for more understanding
    • Program Dependence Graph - explicit representation of data and control dependencies 
    • System Dependence Graph - representation of procedure calls between PDG 
    • Software intelligence - reverse engineers the initial state to understand existing intra-application dependencies
  • Techniques that allow for more abstraction
    • Encapsulate field – force code to access the field with getter and setter methods
    • Generalize type – create more general types to allow for more code sharing
    • Replace type-checking code with state/strategy
    • Replace conditional with polymorphism
  • Techniques for breaking code apart into more logical pieces
    • Componentization breaks code down into reusable semantic units that present clear, well-defined, simple-to-use interfaces.
    • Extract class moves part of the code from an existing class into a new class.
    • Extract method, to turn part of a larger method into a new method. By breaking down code in smaller pieces, it is more easily understandable. This is also applicable to functions.
  • Techniques for improving names and location of code
    • Move method or move field – move to a more appropriate class or source file
    • Rename method or rename field – changing the name into a new one that better reveals its purpose
    • Pull up – in object-oriented programming (OOP), move to a superclass
    • Push down – in OOP, move to a subclass
  • Automatic clone detection

Hardware refactoring

While the term refactoring originally referred exclusively to refactoring of software code, in recent years code written in hardware description languages has also been refactored. The term hardware refactoring is used as a shorthand term for refactoring of code in hardware description languages. Since hardware description languages are not considered to be programming languages by most hardware engineers, hardware refactoring is to be considered a separate field from traditional code refactoring.

Automated refactoring of analog hardware descriptions (in VHDL-AMS) has been proposed by Zeng and Huss. In their approach, refactoring preserves the simulated behavior of a hardware design. The non-functional measurement that improves is that refactored code can be processed by standard synthesis tools, while the original code cannot. Refactoring of digital hardware description languages, albeit manual refactoring, has also been investigated by Synopsys fellow Mike Keating. His target is to make complex systems easier to understand, which increases the designers' productivity.

History

The first known use of the term "refactoring" in the published literature was in a September, 1990 article by William Opdyke and Ralph Johnson. Griswold's Ph.D. thesis, Opdyke's Ph.D. thesis, published in 1992, also used this term. Although refactoring code has been done informally for decades, William Griswold's 1991 Ph.D. dissertation is one of the first major academic works on refactoring functional and procedural programs, followed by William Opdyke's 1992 dissertation on the refactoring of object-oriented programs, although all the theory and machinery have long been available as program transformation systems. All of these resources provide a catalog of common methods for refactoring; a refactoring method has a description of how to apply the method and indicators for when you should (or should not) apply the method.

Martin Fowler's book Refactoring: Improving the Design of Existing Code is the canonical reference.

The terms "factoring" and "factoring out" have been used in this way in the Forth community since at least the early 1980s. Chapter Six of Leo Brodie's book Thinking Forth (1984) is dedicated to the subject.

In extreme programming, the Extract Method refactoring technique has essentially the same meaning as factoring in Forth; to break down a "word" (or function) into smaller, more easily maintained functions.

Refactorings can also be reconstructed posthoc to produce concise descriptions of complex software changes recorded in software repositories like CVS or SVN.

Automated code refactoring

Many software editors and IDEs have automated refactoring support. Here is a list of a few of these editors, or so-called refactoring browsers.

Software rot

From Wikipedia, the free encyclopedia

Software rot (bit rot, code rot, software erosion, software decay, or software entropy) is either a slow deterioration of software quality over time or its diminishing responsiveness that will eventually lead to software becoming faulty, unusable, or in need of upgrade. This is not a physical phenomenon; the software does not actually decay, but rather suffers from a lack of being responsive and updated with respect to the changing environment in which it resides.

The Jargon File, a compendium of hacker lore, defines "bit rot" as a jocular explanation for the degradation of a software program over time even if "nothing has changed"; the idea behind this is almost as if the bits that make up the program were subject to radioactive decay.

Causes

Several factors are responsible for software rot, including changes to the environment in which the software operates, degradation of compatibility between parts of the software itself, and the appearance of bugs in unused or rarely used code.

Environment change

When changes occur in the program's environment, particularly changes which the designer of the program did not anticipate, the software may no longer operate as originally intended. For example, many early computer game designers used the CPU clock speed as a timer in their games. However, newer CPU clocks were faster, so the gameplay speed increased accordingly, making the games less usable over time.

Onceability

There are changes in the environment not related to the program's designer, but its users. Initially, a user could bring the system into working order, and have it working flawlessly for a certain amount of time. But, when the system stops working correctly, or the users want to access the configuration controls, they cannot repeat that initial step because of the different context and the unavailable information (password lost, missing instructions, or simply a hard-to-manage user interface that was first configured by trial and error). Information Architect Jonas Söderström has named this concept Onceability, and defines it as "the quality in a technical system that prevents a user from restoring the system, once it has failed".

Unused code

Infrequently used portions of code, such as document filters or interfaces designed to be used by other programs, may contain bugs that go unnoticed. With changes in user requirements and other external factors, this code may be executed later, thereby exposing the bugs and making the software appear less functional.

Rarely updated code

Normal maintenance of software and systems may also cause software rot. In particular, when a program contains multiple parts which function at arm's length from one another, failing to consider how changes to one part that affect the others may introduce bugs.

In some cases, this may take the form of libraries that the software uses being changed in a way which adversely affects the software. If the old version of a library that previously worked with the software can no longer be used due to conflicts with other software or security flaws that were found in the old version, there may no longer be a viable version of a needed library for the program to use.

Online connectivity

Modern commercial software often connects to an online server for license verification and accessing information. If the online service powering the software is shut down, it may stop working.

Since the late 2010s most websites use secure HTTPS connections. However this requires encryption keys called root certificates which have expiration dates. After the certificates expire the device loses connectivity to most websites unless the keys are continuously updated.

Another issue is that in March 2021 old encyption standards TLS 1.0 and TLS 1.1 were deprecated. This means that operating systems, browsers and other online software that do not support at least TLS 1.2 cannot connect to most websites, even to download patches or update the browser, if these are available. This is occasionally called the "TLS apocalypse".

Products that cannot connect to most websites include PowerMacs, old Unix boxes and Microsoft Windows versions older than Server 2008/Windows 7. The Internet Explorer 8 browser in Server 2008/Windows 7 does support TLS 1.2 but it is disabled by default.

Classification

Software rot is usually classified as being either dormant rot or active rot.

Dormant rot

Software that is not currently being used gradually becomes unusable as the remainder of the application changes. Changes in user requirements and the software environment also contribute to the deterioration.

Active rot

Software that is being continuously modified may lose its integrity over time if proper mitigating processes are not consistently applied. However, much software requires continuous changes to meet new requirements and correct bugs, and re-engineering software each time a change is made is rarely practical. This creates what is essentially an evolution process for the program, causing it to depart from the original engineered design. As a consequence of this and a changing environment, assumptions made by the original designers may be invalidated, thereby introducing bugs.

In practice, adding new features may be prioritized over updating documentation; without documentation, however, it is possible for specific knowledge pertaining to parts of the program to be lost. To some extent, this can be mitigated by following best current practices for coding conventions.

Active software rot slows once an application is near the end of its commercial life and further development ceases. Users often learn to work around any remaining software bugs, and the behaviour of the software becomes consistent as nothing is changing.

Examples

AI program example

Many seminal programs from the early days of AI research have suffered from irreparable software rot. For example, the original SHRDLU program (an early natural language understanding program) cannot be run on any modern day computer or computer simulator, as it was developed during the days when LISP and PLANNER were still in development stage, and thus uses non-standard macros and software libraries which do not exist anymore.

Online forum example

Suppose an administrator creates a forum using open source forum software, and then heavily modifies it by adding new features and options. This process requires extensive modifications to existing code and deviation from the original functionality of that software.

From here, there are several ways software rot can affect the system:

  • The administrator can accidentally make changes which conflict with each other or the original software, causing the forum to behave unexpectedly or break down altogether. This leaves them in a very bad position: as they have deviated so greatly from the original code, technical support and assistance in reviving the forum will be difficult to obtain.
  • A security hole may be discovered in the original forum source code, requiring a security patch. However, because the administrator has modified the code so extensively, the patch may not be directly applicable to their code, requiring the administrator to effectively rewrite the update.
  • The administrator who made the modifications could vacate their position, leaving the new administrator with a convoluted and heavily modified forum that lacks full documentation. Without fully understanding the modifications, it is difficult for the new administrator to make changes without introducing conflicts and bugs. Furthermore, documentation of the original system may no longer be available, or worse yet, misleading due to subtle differences in functional requirements.

Refactoring

Refactoring is a means of addressing the problem of software rot. It is described as the process of rewriting existing code to improve its structure without affecting its external behaviour. This includes removing dead code and rewriting sections that have been modified extensively and no longer work efficiently. Care must be taken not to change the software's external behaviour, as this could introduce incompatibilities and thereby itself contribute to software rot.

 

Rheumatism

From Wikipedia, the free encyclopedia
 
Rheumatism
Other namesRheumatic disease
SpecialtyRheumatology
ComplicationsAmplified musculoskeletal pain syndrome

Rheumatism or rheumatic disorders are conditions causing chronic, often intermittent pain affecting the joints or connective tissue. Rheumatism does not designate any specific disorder, but covers at least 200 different conditions, including arthritis and "non-articular rheumatism", also known as "regional pain syndrome" or "soft tissue rheumatism". There is a close overlap between the term soft tissue disorder and rheumatism. Sometimes the term "soft tissue rheumatic disorders" is used to describe these conditions.

The term "Rheumatic Diseases" is used in MeSH to refer to connective tissue disorders. The branch of medicine devoted to the diagnosis and therapy of rheumatism is called rheumatology.

Types

Many rheumatic disorders of chronic, intermittent pain (including joint pain, neck pain or back pain) have historically been caused by infectious diseases. Their etiology was unknown until the 20th century and not treatable. Postinfectious arthritis, also known as reactive arthritis, and rheumatic fever are other examples.

In the United States, major rheumatic disorders are divided into 10 major categories based on the nomenclature and classification proposed by the American College of Rheumatology (ACR) in 1983.

Diagnosis

Blood and urine tests will measure levels of creatinine and uric acid to determine kidney function, an elevation of the ESR and CRP is possible. After a purine-restricted diet, another urine test will help determine whether the body is producing too much uric acid or the body isn't excreting enough uric acid. Rheumatoid factor may be present, especially in the group that is likely to develop rheumatoid arthritis. A fine needle is used to draw fluid from a joint to determine if there is any build up of fluid. The presence of uric acid crystals in the fluid would indicate gout. In many cases there may be no specific test, and it is often a case of eliminating other conditions before getting a correct diagnosis.

Management

Initial therapy of the major rheumatological diseases is with analgesics, such as paracetamol and non-steroidal anti-inflammatory drugs (NSAIDs). Steroids, especially glucocorticoids, and stronger analgesics are often required for more severe cases.

Etymology

The term rheumatism stems from the Late Latin rheumatismus, ultimately from Greek ῥευματίζομαι "to suffer from a flux", with rheum meaning bodily fluids, i.e., any discharge of blood or bodily fluid.

Before the 17th century, the joint pain which was thought to be caused by viscous humours seeping into the joints was always referred to as gout, a word adopted in Middle English from Old French gote "a drop; the gout, rheumatism".

The English term rheumatism in the current sense has been in use since the late 17th century, as it was believed that chronic joint pain was caused by excessive flow of rheum which means bodily fluids into a joint.

Rheumatology

From Wikipedia, the free encyclopedia
Rheumatology
SystemMusculoskeletal, Immune
Significant diseasesAutoimmune disease Inflammation, Rheumatoid arthritis, Lupus, Osteoarthritis, Psoriatic arthritis, Ankylosing spondylitis, Gout, Osteoporosis
Significant testsJoint aspirate, Musculoskeletal exam, X-ray
SpecialistRheumatologist

Rheumatology (Greek ῥεῦμα, rheûma, flowing current) is a branch of medicine devoted to the diagnosis and management of disorders whose common feature is inflammation in the bones, muscles, joints, and internal organs. Rheumatology covers more than 100 different complex diseases, collectively known as rheumatic diseases, which includes many forms of arthritis as well as lupus and Sjögren's syndrome. Doctors who have undergone formal training in rheumatology are called rheumatologists.

Many of these diseases are now known to be disorders of the immune system, and rheumatology has significant overlap with immunology, the branch of medicine that studies the immune system.

Rheumatologist

Rheumatologist
Occupation
NamesDoctor, Medical Specialist
Occupation type
Specialty
Activity sectors
Medicine
Description
Education required
Fields of
employment
Hospitals, Clinics

A rheumatologist is a physician who specializes in the field of medical sub-specialty called rheumatology. A rheumatologist holds a board certification after specialized training. In the United States, training in this field requires four years undergraduate school, four years of medical school, and then three years of residency, followed by two or three years additional Fellowship training. The requirements may vary in other countries. Rheumatologists are internists who are qualified by additional postgraduate training and experience in the diagnosis and treatment of arthritis and other diseases of the joints, muscles and bones. Many rheumatologists also conduct research to determine the cause and better treatments for these disabling and sometimes fatal diseases. Treatment modalities are based on scientific research, currently, practice of rheumatology is largely evidence based.

Rheumatologists treat arthritis, autoimmune diseases, pain disorders affecting joints, and osteoporosis. There are more than 200 types of these diseases, including rheumatoid arthritis, osteoarthritis, gout, lupus, back pain, osteoporosis, and tendinitis. Some of these are very serious diseases that can be difficult to diagnose and treat. They treat soft tissue problems related to the musculoskeletal system, and sports related soft tissue disorders.

Diseases

Diseases diagnosed or managed by rheumatologists include:

Degenerative arthropathies

Inflammatory arthropathies

Systemic conditions and connective tissue diseases

Medical laser for the treatment of rheumatism.

Soft tissue rheumatism

Local diseases and lesions affecting the joints and structures around the joints including tendons, ligaments capsules, bursae, stress fractures, muscles, nerve entrapment, vascular lesions, and ganglia. For example:

Diagnosis

Synovial fluid examination
Type WBC (per mm3) % neutrophils Viscosity Appearance
Normal <200 0 High Transparent
Osteoarthritis <5000 <25 High Clear yellow
Trauma <10,000 <50 Variable Bloody
Inflammatory 2,000–50,000 50–80 Low Cloudy yellow
Septic arthritis >50,000 >75 Low Cloudy yellow
Gonorrhea ~10,000 60 Low Cloudy yellow
Tuberculosis ~20,000 70 Low Cloudy yellow
Inflammatory: Arthritis, gout, rheumatoid arthritis, rheumatic fever

Physical examination

Following are examples of methods of diagnosis able to be performed in a normal physical examination.

  • Schober's test tests the flexion of the lower back.
  • Multiple joint inspection
  • Musculoskeletal Examination
    • Screening Musculoskeletal Exam (SMSE) - a rapid assessment of structure and function
    • General Musculoskeletal Exam (GMSE) - a comprehensive assessment of joint inflammation
    • Regional Musculoskeletal Exam (RMSE) - focused assessments of structure, function and inflammation combined with special testing

Specialized

Treatment

Most rheumatic diseases are treated with analgesics, NSAIDs (nonsteroidal anti-inflammatory drug), steroids (in serious cases), DMARDs (disease-modifying antirheumatic drugs), monoclonal antibodies, such as infliximab and adalimumab, the TNF inhibitor etanercept, and methotrexate for moderate to severe rheumatoid arthritis. The biologic agent rituximab (anti-B cell therapy) is now licensed for use in refractory rheumatoid arthritis. Physiotherapy is vital in the treatment of many rheumatological disorders. Occupational therapy can help patients find alternative ways for common movements that would otherwise be restricted by their disease. Patients with rheumatoid arthritis often need a long term, coordinated and a multidisciplinary team approach towards management of individual patients. Treatment is often tailored according to the individual needs of each patient which is also dependent on the response and the tolerability of medications.

Beginning in the 2000s, the incorporation of biopharmaceuticals (which include inhibitors of TNF-alpha, certain interleukins, and the JAK-STAT signaling pathway) into standards of care is one of the paramount developments in modern rheumatology.

Rheumasurgery

Rheumasurgery (or rheumatoid surgery) is a subfield of orthopedics occupied with the surgical treatment of patients with rheumatic diseases. The purpose of the interventions is to limit disease activity, soothe pain and improve function.

Rheumasurgical interventions can be divided in two groups. The one is early synovectomies, that is the removal of the inflamed synovia in order to prevent spreading and stop destruction. The other group is the so-called corrective intervention, i.e. an intervention done after destruction has taken place. Among the corrective interventions are joint replacements, removal of loose bone or cartilage fragments, and a variety of interventions aimed at repositioning and/or stabilizing joints, such as arthrodesis.

Research directions

Recently, a large body of scientific research deals with the background of autoimmune disease, the cause of many rheumatic disorders. Also, the field of osteoimmunology has emerged to further examine the interactions between the immune system, joints, and bones. Epidemiological studies and medication trials are also being conducted. The Rheumatology Research Foundation is the largest private funding source of rheumatology research and training in the United States.

History

Rheumasurgery emerged in the cooperation of rheumatologists and orthopedic surgeons in Heinola, Finland, during the 1950s.

In 1970 a Norwegian investigation estimated that at least 50% of patients with rheumatic symptoms needed rheumasurgery as an integrated part of their treatment.

The European Rheumatoid Arthritis Surgical Society (ERASS) was founded in 1979.

Around the turn of the 21st century, focus for treatment of patients with rheumatic disease shifted, and pharmacological treatment became dominant, while surgical interventions became rarer.

Obesity-associated morbidity

From Wikipedia, the free encyclopedia
 
Obesity-associated morbidity
Obesity may cause a number of medical complications which negatively impact peoples' quality of life.
Death rate from obesity, 2019

Obesity is a risk factor for many chronic physical and mental illnesses.

The health effects of being overweight but not obese are controversial, with some studies showing that the mortality rate for individuals who are classified as overweight (BMI 25.0 to 29.9) may actually be lower than for those with an ideal weight (BMI 18.5 to 24.9). Health risks for those who are overweight may be decreasing over time as a result of improvements in medical care. Some obesity-associated medical conditions may be the result of stress caused by medical discrimination against people who are obese, rather than the direct effects of obesity, and some may be exacerbated by the relatively poor healthcare received by people who are obese.

Medical discrimination

Because of the social stigma of obesity, people who are obese may receive poorer healthcare than people within the normal BMI weight range, potentially contributing to the relationship between obesity and poor health outcomes. People who experience weight-related discrimination, irrespective of their actual weight status, similarly have poorer health outcomes than those who do not experience weight-related discrimination. People who are obese are also less likely to seek medical care than people who are not obese, even if the weight gain is caused by medical problems. Peter Muennig, a professor in the Department of Health Policy and Management at Columbia University, has proposed that obesity-associated medical conditions may be caused "not from adiposity alone, but also from the psychological stress induced by the social stigma associated with being obese".

Cardiological risks

Heart attack (myocardial infarction)

Body weight is not considered to be an independently predictive risk factor for cardiovascular disease by current (as of 2014) risk assessment tools. Mortality from cardiovascular disease has decreased despite increases in obesity, and at least one clinical trial was stopped early because the weight loss intervention being tested did not reduce cardiovascular disease.

Ischemic heart disease

Abdominal obesity is associated with cardiovascular diseases including angina and myocardial infarction. However, overall obesity (as measured by BMI) may lead to false diagnoses of myocardial infarction and may decrease mortality after acute myocardial infarction.

In 2008, European guidelines concluded that 35% of ischemic heart disease among adults in Europe is due to obesity.

Congestive heart failure

Having obesity is associated to about 11% of heart failure cases in males and 14% in females.

High blood pressure

More than 85% of those with hypertension have a BMI greater than 25, although diet is probably a more important factor than body weight. Risk estimates indicate that at least two-thirds of people with hypertension can be directly attributed to obesity. The association between obesity and hypertension has been found in animal and clinical studies, which have suggested that there are multiple potential mechanisms for obesity-induced hypertension. These mechanisms include the activation of the sympathetic nervous system as well as the activation of the renin–angiotensin–aldosterone system. As of 2007, it was unclear whether there is an association between hypertension and obesity in children, but there is little direct evidence that blood pressure has increased despite increases in pediatric overweight.

Abnormal cholesterol levels

Obesity is associated with increased levels of LDL cholesterol and lower levels of HDL cholesterol in the blood.

Deep vein thrombosis and pulmonary embolism

Obesity increases one's risk of venous thromboembolism by approximately 2.3 fold.

Dermatological risks

Obesity is associated with the incidence of stretch marks, acanthosis nigricans, lymphedema, cellulitis, hirsutism, and intertrigo.

Endocrine risks

Gynecomastia in an obese male

Diabetes mellitus

The link between obesity and type 2 diabetes is so strong that researchers in the 1970s started calling it "diabesity". Excess weight is behind 64% of cases of diabetes in males and 77% of cases in females.

Gynecomastia

In some individuals, obesity can be associated with elevated peripheral conversion of androgens into estrogens.

Gastrointestinal risks

Gastroesophageal reflux disease

Several studies have shown that the frequency and severity of GERD symptoms increase with BMI, such that people who are underweight have the fewest GERD symptoms, and people who are severely obese have the most GERD symptoms. However, most studies find that GERD symptoms are not improved by nonsurgical weight loss.

Cholelithiasis (gallstones)

Obesity causes the amount of cholesterol in bile to rise, in turn the formation of stone can occur.

Reproductive system (or genital system)

Polycystic ovarian syndrome (PCOS)

Due to its association with insulin resistance, the risk of obesity increases with polycystic ovarian syndrome (PCOS). In the US approximately 60% of patients with PCOS have a BMI greater than 30. It remains uncertain whether PCOS contributes to obesity, or the reverse.

Infertility

Obesity can lead to infertility in both males and females. This is primarily due to excess estrogen interfering with normal ovulation in females and altering spermatogenesis in males. It is believed to cause 6% of primary infertility. A review in 2013 came to the result that obesity increases the risk of oligospermia and azoospermia in males, with an of odds ratio 1.3. Being morbidly obese increases the odds ratio to 2.0.

Complications of pregnancy

Obesity is related to many complications in pregnancy including: haemorrhage, infection, increased hospital stays for the mother, and increased NICU requirements for the infant. Obese females also have increased risk of preterm births and low birth weight infants.

Obese females have more than twice the rate of C-sections compared to females of "normal" weight. Some have suggested that this may be due in part to the social stigma of obesity.

Birth defects

Those who are obese during pregnancy have a greater risk of have a child with a number of congenital malformations including: neural tube defects such as anencephaly and spina bifida, cardiovascular anomalies, including septal anomalies, cleft lip and palate, anorectal malformation, limb reduction anomalies, and hydrocephaly.

Intrauterine fetal death

Maternal obesity is associated with an increased risk of intrauterine fetal death.

Buried penis

Excess body fat in morbid obesity can, in some cases, completely obscure or "bury" the penis.

Neurological risks

MCA territory infarct (stroke)

Stroke

Ischemic stroke is increased in both men and women who are obese.

Meralgia paresthetica

Meralgia paresthetica is a neuropathic pain or numbness of the thighs, sometimes associated with obesity.

Migraines

Migraine (and headaches in general) is comorbid with obesity. The risk of migraine rises 50% by BMI of 30 kg/m2 and 100% by BMI of 35 kg/m2. The causal connection remains unclear.

Carpal tunnel syndrome

The risk of carpal tunnel syndrome is estimated to rise 7.4% for each 1 kg/m2 increase of body mass index.

Dementia

One review found that those who are obese do not have a significantly higher rate of dementia than those with "normal" weight.

Idiopathic intracranial hypertension

Idiopathic intracranial hypertension, or unexplained high pressure in the cranium, is a rare condition that can cause visual impairment, frequent severe headache, and tinnitus. It is most commonly seen in obese women, and the incidence of idiopathic intracranial hypertension is increasing along with increases in the number of people who are obese.

Multiple sclerosis

Obese female individuals at 18 years of age have a greater than twofold increased risk of multiple sclerosis compared to females with a BMI between 18.5 and 20.9. Female individuals who are underweight at age 18 have the lowest risk of multiple sclerosis. However, body weight as an adult was not associated with risk of multiple sclerosis.

Cancer

Hepatocellular carcinoma 1

Many cancers occur at increased frequency in those who are overweight or obese. A study from the United Kingdom found that approximately 5% of cancer is due to excess weight. These cancers include:

A high body mass index (BMI) is associated with a higher risk of developing ten common cancers including 41% of uterine cancers and at least 10% of gallbladder, kidney, liver and colon cancers in the UK. For those undergoing surgery for cancer, obesity is also associated with an increased risk of major postoperative complications compared with those of "normal" weight.

Psychiatric risks

Risk of death from suicide decreases with increased body mass index in the United States.

Depression

Obesity has been associated with depression, likely due to social factors rather than physical effects of obesity. However, it is possible that obesity is caused by depression (due to reduced physical activity or, in some people, increases in appetite). Obesity-related disabilities may also lead to depression in some people. Repeated failed attempts at weight loss might also lead to depression.

The association between obesity and depression is strongest in those who are more severely obese, those who are younger, and in women. Suicide rate however decreases with increased BMI. Similarly, weight loss through bariatric surgery is associated with increased risk of suicide.

Social stigmatization

Obese people draw negative reactions from others, and people are less willing to help obese individuals in any situation due to social stigmatization. People who are obese also experience fewer educational and career opportunities, on average earn a lesser income, and generally receive poorer health care and treatment than individuals of "normal" weight.

Respiratory system

Obstructive sleep apnea

Obesity is a risk factor for obstructive sleep apnea.

Obesity hypoventilation syndrome

CPAP machine commonly used in OHS

Obesity hypoventilation syndrome is defined as the combination of obesity, hypoxia during sleep, and hypercapnia during the day, resulting from hypoventilation.

Chronic lung disease

Obesity is associated with a number of chronic lung diseases, including asthma and COPD. It is believed that a systemic pro-inflammatory state induced by some causes of obesity may contribute to airway inflammation, leading to asthma.

Complications during general anaesthesia

Obesity significantly reduces and stiffens the functional lung volume, requiring specific strategies for respiratory management under general anesthesia.

Obesity and asthma

The low grade systemic inflammation of obesity has been shown to worsen lung function in asthma and increase the risk of developing an asthma exacerbation.

COVID-19

A study in England found a linear increase in severe COVID-19 resulting in hospitalisation and death for those whose BMI is above 23, and a linear increase in admission to an intensive care unit across the whole BMI spectrum. The difference in COVID-19 risk from having a high BMI was most pronounced in people aged under 40, or who were black. A study from Mexico found that obesity alone was responsible for a 2.7 times increased risk of death from COVID-19, while comorbidities with diabetes, immunosuppression or high blood pressure increased the risk further. A study from the United States found that there was an inverse correlation between age and BMI of COVID patients; the younger the age group, the higher its BMI.

Rheumatological and orthopedic risks

Gout

Gout

Compared to men with a BMI of 21–22.9, men with a BMI of 30–34.9 have 2.33 times more gout, and men with a BMI ≥ 35 have 2.97 times more gout. Weight loss decreases these risks.

Poor mobility

There is a strong association between obesity and musculoskeletal pain and disability.

Osteoarthritis

Increased rates of arthritis are seen in both weight-bearing and non-weight-bearing joints. Weight loss and exercise act to reduce the risk of osteoarthritis.

Low back pain

Obese individuals are twice to four times more likely to have lower back pain than their "normal" weight peers.

Traumatic injury

In females, low BMI is a risk factor for osteoporotic fractures in general. In contrast, obesity is a protective factor for most osteoporotic fractures.

Urological and nephrological risks

Urinary system

Urinary incontinence

Urge, stress, and mixed incontinence all occur at higher rates in obese people. The rates of urinary incontinence are about double that found in the "normal" weight population. Urinary incontinence improves with weight loss.

Chronic kidney disease

Obesity increases one's risk of chronic kidney disease by three to four times.

Hypogonadism

In males, obesity and metabolic syndrome both increase estrogen and adipokine production. This reduces gonadotropin-releasing hormone, in turn reducing both luteinizing hormone and follicle stimulating hormone. The result is reduction of the testis' production of testosterone and a further increase in adipokine levels. This then feeds back to cause further weight gain.

Erectile dysfunction

Obese male individuals can experience erectile dysfunction, and weight loss can improve their sexual functioning.

Politics of Europe

From Wikipedia, the free encyclopedia ...