koriaf/django-calories-log

View on GitHub

Showing 22 of 22 total issues

Function storeHistoricalData has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        storeHistoricalData(productsToday) {
            // Calculates today total values and saves to indexedDB
            // so we can draw some graphs about how we eat
            // TODO: move process logic level up and here just store it

Severity: Minor
Found in src/frontend/backlog.app/db-storage.js - About 1 hr to fix

    Function doFoodSearch has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            doFoodSearch: function doFoodSearch() {
                var q = document.querySelector("#id_food_search_input").value.trim();
                // fetch list of goods by AJAX from server side using our API
                let url = "/api/v1/products/" + Views.serialize({title: q});
                let errorBlock = document.querySelector("#id_found_food_table_message");
    Severity: Minor
    Found in src/frontend/backlog.app/backlog.app.js - About 1 hr to fix

      Function handle has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          def handle(self, *args, **options):
              CATEGORIES = self.parse_categories()
              PRODUCTS = self.parse_foods(CATEGORIES)
              NUTRIENTS = self.parse_nutrients()
      
      
      Severity: Minor
      Found in src/nutricalc/food/management/commands/parse_usa_db.py - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Similar blocks of code found in 4 locations. Consider refactoring.
      Open

                  try:
                      ccal = float(prod['nutrients'][self.CCAL_ID]['value'])
                  except KeyError:
                      ccal = -1
      Severity: Major
      Found in src/nutricalc/food/management/commands/parse_usa_db.py and 3 other locations - About 1 hr to fix
      src/nutricalc/food/management/commands/parse_usa_db.py on lines 121..124
      src/nutricalc/food/management/commands/parse_usa_db.py on lines 125..128
      src/nutricalc/food/management/commands/parse_usa_db.py on lines 129..132

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 41.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 4 locations. Consider refactoring.
      Open

                  try:
                      prot = float(prod['nutrients'][self.PROT_ID]['value'])
                  except KeyError:
                      prot = -1
      Severity: Major
      Found in src/nutricalc/food/management/commands/parse_usa_db.py and 3 other locations - About 1 hr to fix
      src/nutricalc/food/management/commands/parse_usa_db.py on lines 125..128
      src/nutricalc/food/management/commands/parse_usa_db.py on lines 129..132
      src/nutricalc/food/management/commands/parse_usa_db.py on lines 133..136

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 41.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

        module.exports.TableRow = React.createClass({
            render: function() {
                return <tr>
                        {this.props.children}
                       </tr>
      Severity: Major
      Found in src/frontend/backlog.app/components/base.table.jsx and 2 other locations - About 1 hr to fix
      src/frontend/backlog.app/components/base.table.jsx on lines 15..21
      src/frontend/backlog.app/components/base.table.jsx on lines 23..29

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 60.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 4 locations. Consider refactoring.
      Open

                  try:
                      carb = float(prod['nutrients'][self.CARB_ID]['value'])
                  except KeyError:
                      carb = -1
      Severity: Major
      Found in src/nutricalc/food/management/commands/parse_usa_db.py and 3 other locations - About 1 hr to fix
      src/nutricalc/food/management/commands/parse_usa_db.py on lines 121..124
      src/nutricalc/food/management/commands/parse_usa_db.py on lines 125..128
      src/nutricalc/food/management/commands/parse_usa_db.py on lines 133..136

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 41.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

        module.exports.TableBody = React.createClass({
            render: function() {
                return <tbody>
                        {this.props.children}
                       </tbody>
      Severity: Major
      Found in src/frontend/backlog.app/components/base.table.jsx and 2 other locations - About 1 hr to fix
      src/frontend/backlog.app/components/base.table.jsx on lines 15..21
      src/frontend/backlog.app/components/base.table.jsx on lines 31..37

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 60.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

        module.exports.TableHeader = React.createClass({
            render: function() {
                return <thead>
                          {this.props.children}
                       </thead>
      Severity: Major
      Found in src/frontend/backlog.app/components/base.table.jsx and 2 other locations - About 1 hr to fix
      src/frontend/backlog.app/components/base.table.jsx on lines 23..29
      src/frontend/backlog.app/components/base.table.jsx on lines 31..37

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 60.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 4 locations. Consider refactoring.
      Open

                  try:
                      fat = float(prod['nutrients'][self.FAT_ID]['value'])
                  except KeyError:
                      fat = -1
      Severity: Major
      Found in src/nutricalc/food/management/commands/parse_usa_db.py and 3 other locations - About 1 hr to fix
      src/nutricalc/food/management/commands/parse_usa_db.py on lines 121..124
      src/nutricalc/food/management/commands/parse_usa_db.py on lines 129..132
      src/nutricalc/food/management/commands/parse_usa_db.py on lines 133..136

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 41.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

              componentDidMount: function() {
                  backlogStore.subscribe(() => {
                      this.setState({products: backlogStore.getState().foundFood})
                  })
              },
      Severity: Minor
      Found in src/frontend/backlog.app/components/found-product.table.jsx and 1 other location - About 55 mins to fix
      src/frontend/backlog.app/components/eaten-product.table.jsx on lines 16..20

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 54.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

              componentDidMount: function() {
                  backlogStore.subscribe(() => {
                      this.setState({products: backlogStore.getState().todayFood})
                  })
              },
      Severity: Minor
      Found in src/frontend/backlog.app/components/eaten-product.table.jsx and 1 other location - About 55 mins to fix
      src/frontend/backlog.app/components/found-product.table.jsx on lines 14..18

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 54.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function get_queryset has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_queryset(self):
              """Custom filtering procedure.
              Accepts 'title' GET argument.
              Do search from food database and return partial matches
              """
      Severity: Minor
      Found in src/nutricalc/food_api_v1/views.py - About 55 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                      backlogStore.dbStorage.fetchFoodFromBackend().then(allStoredFood => {
                          backlogStore.dispatch({
                              type: symbols.rProductStateReset,
                              newProductList: allStoredFood
                          })
      Severity: Minor
      Found in src/frontend/backlog.app/backlog.store.js and 1 other location - About 55 mins to fix
      src/frontend/backlog.app/backlog.store.js on lines 24..29

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 53.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                      backlogStore.dbStorage.fetchHistoricalData().then(historicalData => {
                          backlogStore.dispatch({
                              type: symbols.rHistoricalDataUpdated,
                              newHistoricalData: historicalData
                          })
      Severity: Minor
      Found in src/frontend/backlog.app/backlog.store.js and 1 other location - About 55 mins to fix
      src/frontend/backlog.app/backlog.store.js on lines 18..23

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 53.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function env has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      def env(name, default):
          """Get variable name and default value, return environment value or default one"""
          value = os.environ.get(name, default)
          if isinstance(default, bool):
              # it's boolean value, must be converted from string
      Severity: Minor
      Found in src/nutricalc/settings/base.py - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

                  if (product.nutr_prot && product.nutr_prot.toFixed) {
                      product.nutr_prot = product.nutr_prot.toFixed(1);
                  }
      Severity: Minor
      Found in src/frontend/backlog.app/components/product.row.jsx and 2 other locations - About 35 mins to fix
      src/frontend/backlog.app/components/product.row.jsx on lines 13..15
      src/frontend/backlog.app/components/product.row.jsx on lines 16..18

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 46.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

                  if (product.nutr_carb && product.nutr_carb.toFixed) {
                      product.nutr_carb = product.nutr_carb.toFixed(1);
                  }
      Severity: Minor
      Found in src/frontend/backlog.app/components/product.row.jsx and 2 other locations - About 35 mins to fix
      src/frontend/backlog.app/components/product.row.jsx on lines 10..12
      src/frontend/backlog.app/components/product.row.jsx on lines 13..15

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 46.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

                  if (product.nutr_fat && product.nutr_fat.toFixed) {
                      product.nutr_fat = product.nutr_fat.toFixed(1);
                  }
      Severity: Minor
      Found in src/frontend/backlog.app/components/product.row.jsx and 2 other locations - About 35 mins to fix
      src/frontend/backlog.app/components/product.row.jsx on lines 10..12
      src/frontend/backlog.app/components/product.row.jsx on lines 16..18

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 46.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function parse_nutrients has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def parse_nutrients(self):
              raw_defs = open(os.path.join(
                  settings.BASE_DIR,
                  '../var/usa_food_gov',
                  'NUTR_DEF.txt'
      Severity: Minor
      Found in src/nutricalc/food/management/commands/parse_usa_db.py - About 25 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Severity
      Category
      Status
      Source
      Language