thundergolfer/mAIcroft

View on GitHub

Showing 322 of 322 total issues

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

        for value, count in Counter(
            [value for value, source in self.places_lived_extra]
        ).most_common():
            sources = [s for v, s in self.places_lived_extra if v == value]
            places_lived_extra.append(
Severity: Major
Found in maicroft/users/reddit_user.py and 12 other locations - About 3 hrs to fix
maicroft/users/reddit_user.py on lines 1140..1148
maicroft/users/reddit_user.py on lines 1166..1174
maicroft/users/reddit_user.py on lines 1179..1187
maicroft/users/reddit_user.py on lines 1192..1200
maicroft/users/reddit_user.py on lines 1205..1213
maicroft/users/reddit_user.py on lines 1218..1226
maicroft/users/reddit_user.py on lines 1231..1239
maicroft/users/reddit_user.py on lines 1244..1252
maicroft/users/reddit_user.py on lines 1257..1265
maicroft/users/reddit_user.py on lines 1270..1278
maicroft/users/reddit_user.py on lines 1283..1291
maicroft/users/reddit_user.py on lines 1296..1304

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 73.

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 13 locations. Consider refactoring.
Open

        for value, count in Counter(
            [value for value, source in self.actions]
        ).most_common():
            sources = [s for v, s in self.actions if v == value]
            actions.append(
Severity: Major
Found in maicroft/users/reddit_user.py and 12 other locations - About 3 hrs to fix
maicroft/users/reddit_user.py on lines 1140..1148
maicroft/users/reddit_user.py on lines 1153..1161
maicroft/users/reddit_user.py on lines 1166..1174
maicroft/users/reddit_user.py on lines 1179..1187
maicroft/users/reddit_user.py on lines 1192..1200
maicroft/users/reddit_user.py on lines 1205..1213
maicroft/users/reddit_user.py on lines 1218..1226
maicroft/users/reddit_user.py on lines 1231..1239
maicroft/users/reddit_user.py on lines 1244..1252
maicroft/users/reddit_user.py on lines 1257..1265
maicroft/users/reddit_user.py on lines 1270..1278
maicroft/users/reddit_user.py on lines 1296..1304

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 73.

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 13 locations. Consider refactoring.
Open

        for value, count in Counter(
            [value for value, source in self.possessions_extra]
        ).most_common():
            sources = [s for v, s in self.possessions_extra if v == value]
            possessions_extra.append(
Severity: Major
Found in maicroft/users/reddit_user.py and 12 other locations - About 3 hrs to fix
maicroft/users/reddit_user.py on lines 1140..1148
maicroft/users/reddit_user.py on lines 1153..1161
maicroft/users/reddit_user.py on lines 1166..1174
maicroft/users/reddit_user.py on lines 1179..1187
maicroft/users/reddit_user.py on lines 1192..1200
maicroft/users/reddit_user.py on lines 1205..1213
maicroft/users/reddit_user.py on lines 1218..1226
maicroft/users/reddit_user.py on lines 1231..1239
maicroft/users/reddit_user.py on lines 1244..1252
maicroft/users/reddit_user.py on lines 1257..1265
maicroft/users/reddit_user.py on lines 1283..1291
maicroft/users/reddit_user.py on lines 1296..1304

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 73.

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 13 locations. Consider refactoring.
Open

        for value, count in Counter(
            [value for value, source in self.places_lived]
        ).most_common():
            sources = [s for v, s in self.places_lived if v == value]
            places_lived.append(
Severity: Major
Found in maicroft/users/reddit_user.py and 12 other locations - About 3 hrs to fix
maicroft/users/reddit_user.py on lines 1153..1161
maicroft/users/reddit_user.py on lines 1166..1174
maicroft/users/reddit_user.py on lines 1179..1187
maicroft/users/reddit_user.py on lines 1192..1200
maicroft/users/reddit_user.py on lines 1205..1213
maicroft/users/reddit_user.py on lines 1218..1226
maicroft/users/reddit_user.py on lines 1231..1239
maicroft/users/reddit_user.py on lines 1244..1252
maicroft/users/reddit_user.py on lines 1257..1265
maicroft/users/reddit_user.py on lines 1270..1278
maicroft/users/reddit_user.py on lines 1283..1291
maicroft/users/reddit_user.py on lines 1296..1304

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 73.

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 13 locations. Consider refactoring.
Open

        for value, count in Counter(
            [value for value, source in self.favorites]
        ).most_common():
            sources = [s for v, s in self.favorites if v == value]
            favorites.append(
Severity: Major
Found in maicroft/users/reddit_user.py and 12 other locations - About 3 hrs to fix
maicroft/users/reddit_user.py on lines 1140..1148
maicroft/users/reddit_user.py on lines 1153..1161
maicroft/users/reddit_user.py on lines 1166..1174
maicroft/users/reddit_user.py on lines 1179..1187
maicroft/users/reddit_user.py on lines 1192..1200
maicroft/users/reddit_user.py on lines 1205..1213
maicroft/users/reddit_user.py on lines 1231..1239
maicroft/users/reddit_user.py on lines 1244..1252
maicroft/users/reddit_user.py on lines 1257..1265
maicroft/users/reddit_user.py on lines 1270..1278
maicroft/users/reddit_user.py on lines 1283..1291
maicroft/users/reddit_user.py on lines 1296..1304

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 73.

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 13 locations. Consider refactoring.
Open

        for value, count in Counter(
            [value for value, source in self.attributes_extra]
        ).most_common():
            sources = [s for v, s in self.attributes_extra if v == value]
            attributes_extra.append(
Severity: Major
Found in maicroft/users/reddit_user.py and 12 other locations - About 3 hrs to fix
maicroft/users/reddit_user.py on lines 1140..1148
maicroft/users/reddit_user.py on lines 1153..1161
maicroft/users/reddit_user.py on lines 1166..1174
maicroft/users/reddit_user.py on lines 1179..1187
maicroft/users/reddit_user.py on lines 1192..1200
maicroft/users/reddit_user.py on lines 1205..1213
maicroft/users/reddit_user.py on lines 1218..1226
maicroft/users/reddit_user.py on lines 1231..1239
maicroft/users/reddit_user.py on lines 1257..1265
maicroft/users/reddit_user.py on lines 1270..1278
maicroft/users/reddit_user.py on lines 1283..1291
maicroft/users/reddit_user.py on lines 1296..1304

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 73.

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 13 locations. Consider refactoring.
Open

        for value, count in Counter(
            [value for value, source in self.places_grew_up]
        ).most_common():
            sources = [s for v, s in self.places_grew_up if v == value]
            places_grew_up.append(
Severity: Major
Found in maicroft/users/reddit_user.py and 12 other locations - About 3 hrs to fix
maicroft/users/reddit_user.py on lines 1140..1148
maicroft/users/reddit_user.py on lines 1153..1161
maicroft/users/reddit_user.py on lines 1179..1187
maicroft/users/reddit_user.py on lines 1192..1200
maicroft/users/reddit_user.py on lines 1205..1213
maicroft/users/reddit_user.py on lines 1218..1226
maicroft/users/reddit_user.py on lines 1231..1239
maicroft/users/reddit_user.py on lines 1244..1252
maicroft/users/reddit_user.py on lines 1257..1265
maicroft/users/reddit_user.py on lines 1270..1278
maicroft/users/reddit_user.py on lines 1283..1291
maicroft/users/reddit_user.py on lines 1296..1304

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 73.

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 13 locations. Consider refactoring.
Open

        for value, count in Counter(
            [value for value, source in self.places_grew_up_extra]
        ).most_common():
            sources = [s for v, s in self.places_grew_up_extra if v == value]
            places_grew_up_extra.append(
Severity: Major
Found in maicroft/users/reddit_user.py and 12 other locations - About 3 hrs to fix
maicroft/users/reddit_user.py on lines 1140..1148
maicroft/users/reddit_user.py on lines 1153..1161
maicroft/users/reddit_user.py on lines 1166..1174
maicroft/users/reddit_user.py on lines 1192..1200
maicroft/users/reddit_user.py on lines 1205..1213
maicroft/users/reddit_user.py on lines 1218..1226
maicroft/users/reddit_user.py on lines 1231..1239
maicroft/users/reddit_user.py on lines 1244..1252
maicroft/users/reddit_user.py on lines 1257..1265
maicroft/users/reddit_user.py on lines 1270..1278
maicroft/users/reddit_user.py on lines 1283..1291
maicroft/users/reddit_user.py on lines 1296..1304

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 73.

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 13 locations. Consider refactoring.
Open

        for value, count in Counter(
            [value for value, source in self.family_members]
        ).most_common():
            sources = [s for v, s in self.family_members if v == value]
            family_members.append(
Severity: Major
Found in maicroft/users/reddit_user.py and 12 other locations - About 3 hrs to fix
maicroft/users/reddit_user.py on lines 1140..1148
maicroft/users/reddit_user.py on lines 1153..1161
maicroft/users/reddit_user.py on lines 1166..1174
maicroft/users/reddit_user.py on lines 1179..1187
maicroft/users/reddit_user.py on lines 1205..1213
maicroft/users/reddit_user.py on lines 1218..1226
maicroft/users/reddit_user.py on lines 1231..1239
maicroft/users/reddit_user.py on lines 1244..1252
maicroft/users/reddit_user.py on lines 1257..1265
maicroft/users/reddit_user.py on lines 1270..1278
maicroft/users/reddit_user.py on lines 1283..1291
maicroft/users/reddit_user.py on lines 1296..1304

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 73.

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

File text_parser.py has 326 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-

import re

from nltk import RegexpParser
Severity: Minor
Found in maicroft/text_parser.py - About 3 hrs to fix

    Function trigger has 89 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        trigger: function( event, data, elem, onlyHandlers ) {
            var handle, ontype, cur,
                bubbleType, special, tmp, i,
                eventPath = [ elem || document ],
                type = hasOwn.call( event, "type" ) ? event.type : event,
    Severity: Major
    Found in docs/_build/html/_static/jquery-1.11.1.js - About 3 hrs to fix

      Function process_submission has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

          def process_submission(self, submission):
              """
              Process a single submission.
      
              * Updates metrics
      Severity: Minor
      Found in maicroft/users/reddit_user.py - About 3 hrs 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

      Function Animation has 84 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function Animation( elem, properties, options ) {
          var result,
              stopped,
              index = 0,
              length = animationPrefilters.length,
      Severity: Major
      Found in docs/_build/html/_static/jquery-1.11.1.js - About 3 hrs to fix

        Function results has 84 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def results(self):
                """
                Returns accumulated data as JSON.
        
                """
        Severity: Major
        Found in maicroft/users/reddit_user.py - About 3 hrs to fix

          Function extract_chunks has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

              def extract_chunks(self, text):
                  """
                  Given a block of text, extracts and returns useful chunks.
          
                  TODO - Should sentiments be excluded here?
          Severity: Minor
          Found in maicroft/text_parser.py - About 3 hrs 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

          Function Sizzle has 76 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function Sizzle( selector, context, results, seed ) {
              var match, elem, m, nodeType,
                  // QSA vars
                  i, groups, old, nid, newContext, newSelector;
          
          
          Severity: Major
          Found in docs/_build/html/_static/jquery-1.11.1.js - About 3 hrs to fix

            Function buildFragment has 74 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                buildFragment: function( elems, context, scripts, selection ) {
                    var j, elem, contains,
                        tmp, tag, tbody, wrap,
                        l = elems.length,
            
            
            Severity: Major
            Found in docs/_build/html/_static/jquery-1.11.1.js - About 2 hrs to fix

              File most_used_words.py has 289 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              """
                  Credit to the Reddit Analysis project by Randal S. Olson.
              """
              
              import os
              Severity: Minor
              Found in maicroft/words/most_used_words.py - About 2 hrs to fix

                Function add has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    add: function( elem, types, handler, data, selector ) {
                        var tmp, events, t, handleObjIn,
                            special, eventHandle, handleObj,
                            handlers, type, namespaces, origType,
                            elemData = jQuery._data( elem );
                Severity: Major
                Found in docs/_build/html/_static/jquery-1.11.1.js - About 2 hrs to fix

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

                      if (re.test(w)) {
                        var fp = re.exec(w);
                        stem = fp[1];
                        suffix = fp[2];
                        re = new RegExp(mgr0);
                  Severity: Major
                  Found in docs/_build/html/_static/searchtools.js and 1 other location - About 2 hrs to fix
                  docs/_build/html/_static/searchtools.js on lines 144..151

                  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 92.

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language