Report

443 statements analysed.

External dependencies

ctypes (pySMART.utils)
os (pySMART.utils)
platform (pySMART.utils)
pySMART 
  \-attribute (pySMART,pySMART.device)
  \-device (pySMART.device_list,pySMART)
  \-device_list (pySMART)
  \-test_entry (pySMART,pySMART.device)
re (pySMART.device)
subprocess (pySMART.device_list,pySMART.utils,pySMART.device)
warnings (pySMART.utils,pySMART.device)

Raw metrics

type number % previous difference
code 480 48.05 480 =
docstring 305 30.53 305 =
comment 115 11.51 115 =
empty 99 9.91 99 =

Statistics by type

type number old number difference %documented %badname
module 6 6 = 100.00 16.67
class 4 4 = 100.00 25.00
method 20 20 = 100.00 10.00
function 4 4 = 100.00 0.00

Messages by category

type number previous difference
convention 22 22 =
refactor 14 14 =
warning 22 22 =
error 2 2 =

% errors / warnings by module

module error warning refactor convention
pySMART.device 50.00 40.91 42.86 31.82
pySMART.utils 50.00 40.91 7.14 36.36
pySMART.device_list 0.00 9.09 7.14 0.00
pySMART.test_entry 0.00 4.55 21.43 27.27
pySMART 0.00 4.55 0.00 4.55

Messages

message id occurrences
invalid-name 20
unused-variable 7
redefined-outer-name 4
too-many-instance-attributes 3
too-many-arguments 3
too-few-public-methods 3
redefined-builtin 3
unused-wildcard-import 2
unused-argument 2
too-many-branches 2
bad-continuation 2
wildcard-import 1
used-before-assignment 1
unused-import 1
too-many-statements 1
too-many-return-statements 1
too-many-locals 1
relative-import 1
protected-access 1
no-member 1

Global evaluation

Your code has been rated at 8.47/10 (previous run: 8.47/10, +0.00)

Duplication

  now previous difference
nb duplicated lines 0 0 =
percent duplicated lines 0.000 0.000 =

Messages

type module object line col_offset message
convention pySMART   1 0 Invalid module name "pySMART"
warning pySMART   105 0 Relative import 'utils', should be 'pySMART.utils'
refactor pySMART.attribute Attribute 19 0 Too many instance attributes (10/7)
refactor pySMART.attribute Attribute.__init__ 25 4 Too many arguments (11/5)
refactor pySMART.attribute Attribute 19 0 Too few public methods (0/2)
warning pySMART.device   33 0 Wildcard import utils
convention pySMART.device Device.__init__ 108 8 Invalid attribute name "_test_ECD"
refactor pySMART.device Device 35 0 Too many instance attributes (15/7)
warning pySMART.device Device.__init__ 128 21 Unused variable '_stderr'
warning pySMART.device Device._classify 199 21 Unused variable '_stderr'
refactor pySMART.device Device.get_selftest_result 211 4 Too many return statements (8/6)
refactor pySMART.device Device.get_selftest_result 211 4 Too many branches (15/12)
convention pySMART.device Device._guess_SMART_type 288 4 Invalid method name "_guess_SMART_type"
convention pySMART.device Device._make_SMART_warnings 295 4 Invalid method name "_make_SMART_warnings"
warning pySMART.device Device.run_selftest 363 21 Unused variable '_stderr'
warning pySMART.device Device.update 412 20 Redefining built-in 'format'
refactor pySMART.device Device.update 387 4 Too many local variables (22/15)
error pySMART.device Device.update 406 41 Using variable 'message' before assignment
convention pySMART.device Device.update 417 20 Invalid variable name "LBA"
convention pySMART.device Device.update 420 20 Invalid variable name "ASC"
convention pySMART.device Device.update 421 20 Invalid variable name "ASCQ"
convention pySMART.device Device.update 431 20 Invalid variable name "LBA"
warning pySMART.device Device.update 397 17 Unused variable '_stderr'
refactor pySMART.device Device.update 387 4 Too many branches (52/12)
refactor pySMART.device Device.update 387 4 Too many statements (131/50)
warning pySMART.device   33 0 Unused import admin from wildcard import
warning pySMART.device   26 0 Unused import re
warning pySMART.device   33 0 Unused import rescan_device_busses from wildcard import
warning pySMART.device_list DeviceList._cleanup 78 28 Access to a protected member _sd_name of a client class
warning pySMART.device_list DeviceList._initialize 96 17 Unused variable '_stderr'
refactor pySMART.device_list DeviceList 31 0 Too few public methods (0/2)
convention pySMART.test_entry   106 0 Wrong hanging indentation. self.num, self.type, self.status, self.hours, | ^
convention pySMART.test_entry   107 0 Wrong hanging indentation. self.LBA, self.sense, self.ASC, self.ASCQ)) | ^
convention pySMART.test_entry Test_Entry 19 0 Invalid class name "Test_Entry"
convention pySMART.test_entry Test_Entry.__init__ 53 8 Invalid attribute name "LBA"
convention pySMART.test_entry Test_Entry.__init__ 81 8 Invalid attribute name "ASCQ"
convention pySMART.test_entry Test_Entry.__init__ 76 8 Invalid attribute name "ASC"
refactor pySMART.test_entry Test_Entry 19 0 Too many instance attributes (11/7)
warning pySMART.test_entry Test_Entry.__init__ 25 23 Redefining built-in 'format'
refactor pySMART.test_entry Test_Entry.__init__ 25 4 Too many arguments (12/5)
refactor pySMART.test_entry Test_Entry 19 0 Too few public methods (0/2)
convention pySMART.utils   27 0 Invalid constant name "_min_smartctl_ver"
convention pySMART.utils   46 0 Invalid constant name "_req_ma"
convention pySMART.utils   46 9 Invalid constant name "_req_mi"
convention pySMART.utils   49 0 Invalid constant name "smartctl_type"
error pySMART.utils admin 70 19 Module 'os' has no 'getuid' member
convention pySMART.utils pd_to_sd 75 0 Invalid argument name "pd"
warning pySMART.utils rescan_device_busses 105 13 Redefining name '_stderr' from outer scope (line 115)
warning pySMART.utils rescan_device_busses 103 4 Redefining name 'cmd' from outer scope (line 114)
warning pySMART.utils rescan_device_busses 105 4 Redefining name '_stdout' from outer scope (line 115)
warning pySMART.utils rescan_device_busses 105 13 Unused variable '_stderr'
warning pySMART.utils rescan_device_busses 105 4 Unused variable '_stdout'
warning pySMART.utils _warning_on_one_line 107 62 Redefining built-in 'file'
warning pySMART.utils _warning_on_one_line 108 25 Redefining name 'line' from outer scope (line 121)
refactor pySMART.utils _warning_on_one_line 107 0 Too many arguments (6/5)
warning pySMART.utils _warning_on_one_line 107 62 Unused argument 'file'
warning pySMART.utils _warning_on_one_line 108 25 Unused argument 'line'
convention pySMART.utils   114 0 Invalid constant name "cmd"
convention pySMART.utils   115 0 Invalid constant name "_stdout"
convention pySMART.utils   115 9 Invalid constant name "_stderr"