sonntagsgesicht/auxilium

View on GitHub

Showing 105 of 105 total issues

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

    if not exists(join(path, GIT_PATH)):
        code = code or init_git(path=path, venv=env)
Severity: Minor
Found in auxilium/methods/update.py and 1 other location - About 50 mins to fix
auxilium/methods/create.py on lines 71..72

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

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

    parser.add_argument(
        '--upgrade',
        metavar='PKG',
        nargs='?',
        const=config.getboolean('update', 'upgrade', fallback='pip'),
Severity: Minor
Found in auxilium/add_arguments/update.py and 1 other location - About 45 mins to fix
auxilium/add_arguments/update.py on lines 55..60

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

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

Avoid deeply nested control flow statements.
Open

                    while lines and \
                            (lines[0].strip() == '' or
                             lines[0].startswith('#')):
                        removed.append(lines.pop(0).strip())

Severity: Major
Found in auxilium/tools/docmaintain_tools.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if new_lines[-1].strip():
                            f.write(linesep)  # last empty line
                        f.close()
    Severity: Major
    Found in auxilium/tools/docmaintain_tools.py - About 45 mins to fix

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

      latex_documents = [(
          master_doc,
          pkg.__name__ + '.tex',
          pkg.__name__.capitalize() + ' Documentation',
          pkg.__author__,
      Severity: Minor
      Found in pkg/doc/sphinx/conf.py and 1 other location - About 45 mins to fix
      doc/sphinx/conf.py on lines 136..141

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

      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 coverage has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def coverage(pkg=basename(getcwd()), test_dir=TEST_PATH,
      Severity: Minor
      Found in auxilium/tools/coverage_tools.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if lines:
                                new_lines = new_header + ['', ''] + lines
                            else:
                                new_lines = new_header
        
        
        Severity: Major
        Found in auxilium/tools/docmaintain_tools.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if last.get(file, '') == str(getmtime(file)):
                                  this[file] = str(getmtime(file))
                                  log(LEVEL-1,
                                      ICONS[""] +
                                      "no file header update required for %s" % file)
          Severity: Major
          Found in auxilium/tools/docmaintain_tools.py - About 45 mins to fix

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

                parser.add_argument(
                    '--commit',
                    nargs='?',
                    metavar='MSG',
                    const=config.get('update', 'commit', fallback='Commit'),
            Severity: Minor
            Found in auxilium/add_arguments/update.py and 1 other location - About 45 mins to fix
            auxilium/add_arguments/update.py on lines 25..30

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

            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 do has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            def do(pkg=basename(getcwd()), commit=None, tag=None, header=None,
                   push=None, remote=None, remote_usr=None, remote_pwd=None,
                   deploy=None, pypi_usr=None, pypi_pwd=None, archive=None, cleanup=None,
                   path=None, env=None, **kwargs):
                """run deploy process"""
            Severity: Minor
            Found in auxilium/methods/build.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

            Function coverage_coverage has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def coverage_coverage(pkg=basename(getcwd()), test_dir=TEST_PATH,
            Severity: Minor
            Found in auxilium/tools/coverage_tools.py - About 45 mins to fix

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

                  if exists(join(path, "upgrade_requirements.txt")):
                      code = code or module('pip',
                                            "install --upgrade -r upgrade_requirements.txt",
              Severity: Minor
              Found in auxilium/tools/pip_tools.py and 1 other location - About 45 mins to fix
              auxilium/tools/pip_tools.py on lines 37..38

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

              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

              Avoid deeply nested control flow statements.
              Open

                                  if removed and removed[0].startswith('#!'):
                                      new_header[0] = removed[0]
              
                                  # add new header
                                  if lines:
              Severity: Major
              Found in auxilium/tools/docmaintain_tools.py - About 45 mins to fix

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

                latex_documents = [(
                    master_doc,
                    pkg.__name__ + '.tex',
                    pkg.__name__.capitalize() + ' Documentation',
                    pkg.__author__,
                Severity: Minor
                Found in doc/sphinx/conf.py and 1 other location - About 45 mins to fix
                pkg/doc/sphinx/conf.py on lines 112..117

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

                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

                    if exists(join(path, "requirements.txt")):
                        code = code or module('pip', "install -r requirements.txt",
                Severity: Minor
                Found in auxilium/tools/pip_tools.py and 1 other location - About 45 mins to fix
                auxilium/tools/pip_tools.py on lines 41..43

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

                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

                def cleanup():
                    """remove temporary files"""
                    log(INFO, ICONS["clean"] + 'clean profile')
                    # removed profiling data files
                    del_tree(".cprofile")
                Severity: Minor
                Found in auxilium/tools/profile_tools.py and 1 other location - About 40 mins to fix
                auxilium/tools/test_tools.py on lines 53..58

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

                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

                Consider simplifying this complex logical expression.
                Open

                    if venv:
                        # clear virtual environment folder
                        del_tree(venv)
                        # create virtual environment
                        env = create_venv(pkg, venv_path=venv, path=project_path, venv=env)
                Severity: Major
                Found in auxilium/methods/create.py - About 40 mins to fix

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

                  def cleanup(test_dir=TEST_PATH):
                      """remove temporary files"""
                      log(INFO, ICONS["clean"] + 'clean test results')
                      # removed pytest data files
                      del_tree(".pytest_cache")
                  Severity: Minor
                  Found in auxilium/tools/test_tools.py and 1 other location - About 40 mins to fix
                  auxilium/tools/profile_tools.py on lines 28..33

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

                  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 shell has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def shell(command, level=LEVEL, path=getcwd(), venv=None,
                  Severity: Minor
                  Found in auxilium/tools/system_tools.py - About 35 mins to fix

                    Function module has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def module(mdl, command='', level=LEVEL, path=getcwd(), venv=None):
                    Severity: Minor
                    Found in auxilium/tools/system_tools.py - About 35 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language