lucydot/effmass

View on GitHub

Showing 291 of 291 total issues

File jquery-3.5.1.js has 6902 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jQuery JavaScript Library v3.5.1
 * https://jquery.com/
 *
 * Includes Sizzle.js
Severity: Major
Found in docs/build/_static/jquery-3.5.1.js - About 2 wks to fix

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

    ( function( window ) {
    var i,
        support,
        Expr,
        getText,
    Severity: Major
    Found in docs/build/_static/jquery-3.5.1.js - About 1 wk to fix

      File underscore-1.12.0.js has 1437 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      (function (global, factory) {
        typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
        typeof define === 'function' && define.amd ? define('underscore', factory) :
        (global = global || self, (function () {
          var current = global._;
      Severity: Major
      Found in docs/build/_static/underscore-1.12.0.js - About 3 days to fix

        File analysis.py has 710 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        #! /usr/bin/env python3
        """
        A module for analysing the data contained in a :class:`Segment` object.
        
        Contains the :class:`Segment` class and methods for calculating various definitions of the effective mass.
        Severity: Major
        Found in effmass/analysis.py - About 1 day to fix

          File inputs.py has 672 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          #! /usr/bin/env python3
          
          from pathlib import Path
          
          """
          Severity: Major
          Found in effmass/inputs.py - About 1 day to fix

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

            def plot_dos(DataVasp, figsize=_default_figsize):
                """Plots density of states (states/unit-cell) against energy (eV).
            
                Args:
                    DataVasp (DataVasp): instance of the :class:`DataVasp` class.
            Severity: Major
            Found in effmass/outputs.py and 1 other location - About 1 day to fix
            effmass/outputs.py on lines 64..90

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

            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 plot_integrated_dos(DataVasp, figsize=_default_figsize):
                """Plots integrated density of states (states/unit-cell) against energy
                (eV).
            
                Args:
            Severity: Major
            Found in effmass/outputs.py and 1 other location - About 1 day to fix
            effmass/outputs.py on lines 93..118

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

            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 setDocument has 262 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            setDocument = Sizzle.setDocument = function( node ) {
                var hasCompare, subWindow,
                    doc = node ? node.ownerDocument || node : preferredDoc;
            
                // Return early if doc is invalid or already selected
            Severity: Major
            Found in docs/build/_static/jquery-3.5.1.js - About 1 day to fix

              Function ajax has 257 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  ajax: function( url, options ) {
              
                      // If url is an object, simulate pre-1.5 signature
                      if ( typeof url === "object" ) {
                          options = url;
              Severity: Major
              Found in docs/build/_static/jquery-3.5.1.js - About 1 day to fix

                Function __init__ has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
                Open

                    def __init__(self, directory_path, output_name="calculation.out"):
                        r"""
                        Initialises an instance of the :class:`~effmass.inputs.DataAims` class and checks data using :meth:`check_data`.
                
                        Args:
                Severity: Minor
                Found in effmass/inputs.py - About 1 day 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 Stemmer has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
                Open

                var Stemmer = function() {
                
                  var step2list = {
                    ational: 'ate',
                    tional: 'tion',
                Severity: Minor
                Found in docs/build/_static/language_data.js - About 1 day 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

                    def _integrated_dos(self, DataVasp):
                        """Returns slice of :attr:`effmass.DataVasp.integrated_dos` corresponding
                        to the energy range of the segment.
                
                        Args:
                Severity: Major
                Found in effmass/analysis.py and 1 other location - About 1 day to fix
                effmass/analysis.py on lines 847..867

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

                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 _dos(self, DataVasp):
                        """Returns slice of :attr:`effmass.DataVasp.dos` corresponding to the
                        energy range of the segment.
                
                        Args:
                Severity: Major
                Found in effmass/analysis.py and 1 other location - About 1 day to fix
                effmass/analysis.py on lines 869..888

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

                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 Deferred has 178 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    Deferred: function( func ) {
                        var tuples = [
                
                                // action, add listener, callbacks,
                                // ... .then handlers, argument index, [final state]
                Severity: Major
                Found in docs/build/_static/jquery-3.5.1.js - About 7 hrs to fix

                  Function performObjectSearch has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
                  Open

                    performObjectSearch : function(object, otherterms) {
                      var filenames = this._index.filenames;
                      var docnames = this._index.docnames;
                      var objects = this._index.objects;
                      var objnames = this._index.objnames;
                  Severity: Minor
                  Found in docs/build/_static/searchtools.js - About 6 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

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

                  def get_kpoints_before(band_index,
                                         kpoint_index,
                                         Settings,
                                         Data,
                                         truncate_dir_change=True):
                  Severity: Major
                  Found in effmass/extrema.py and 1 other location - About 6 hrs to fix
                  effmass/extrema.py on lines 419..451

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

                  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 get_kpoints_after(band_index,
                                        kpoint_index,
                                        Settings,
                                        Data,
                                        truncate_dir_change=True):
                  Severity: Major
                  Found in effmass/extrema.py and 1 other location - About 6 hrs to fix
                  effmass/extrema.py on lines 385..416

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

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

                    query : function(query) {
                      var i;
                  
                      // stem the searchterms and add them to the correct list
                      var stemmer = new Stemmer();
                  Severity: Minor
                  Found in docs/build/_static/searchtools.js - About 6 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

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

                              for i in range(self.number_of_bands):
                                  energies[i] = vasp_data_energies.reshape(
                                      number_of_kpoints * 2,  # factor of 2 for each kpoint block
                                      self.number_of_bands,
                                  ).T[i][:number_of_kpoints]
                  Severity: Major
                  Found in effmass/inputs.py and 1 other location - About 6 hrs to fix
                  effmass/inputs.py on lines 453..458

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

                  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

                              for i in range(self.number_of_bands):
                                  occupancy[i] = vasp_data_occupancies.reshape(
                                      number_of_kpoints * 2, self.number_of_bands
                                  ).T[i][:number_of_kpoints]
                                  occupancy[self.number_of_bands + i] = vasp_data_occupancies.reshape(
                  Severity: Major
                  Found in effmass/inputs.py and 1 other location - About 6 hrs to fix
                  effmass/inputs.py on lines 444..450

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

                  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